InseeFr / Trevas

Transformation engine and validator for statistics.
MIT License
9 stars 5 forks source link

NaNs #337

Open NicoLaval opened 1 month ago

NicoLaval commented 1 month ago

@noahboerger you reported Trevas sometimes return NaNs results, could you provide examples please?

hadrienk commented 1 month ago

Using floating point arithmetic means NaN is a possibility.

@NicoLaval 0.0 / 0.0 or sqrt(-1) are examples.

What I can see is missing though is the possibility to react on it. Something like if foo = NaN maybe? If we have package/namespace we could put all those in a math package.

noahboerger commented 1 month ago

Yes this is exactly what i have also observed. It seems like in the test cases from BdI cases which are resulting in NaNs are then mapped to nulls, so that at least the script can react on it. Nevertheless i am not sure if this is the correct behaviour, especially because the possibility to distinguish between NaNs and real null values is lost with this approach.

NicoLaval commented 1 month ago

@hadrienk mathematically I agree.

But VTL spec is more precise, Reference manual: