InseeFr / Trevas-TS

JavaScript engine for the Validation and Transformation Language
MIT License
9 stars 8 forks source link

Float numbers precision in arithmetics #112

Closed romaintailhurat closed 1 year ago

romaintailhurat commented 1 year ago

We witness some weird behaviors when doing scalar operations involving float numbers. Here are two examples than can be reproduced in the Trevas storybook:

Using round(a + b, 2) is a temporary bypass but we should be able to fix this issue directly in the engine.

romaintailhurat commented 1 year ago

@NicoLaval so no other solution than manually round, the results are on par with what every language does.