json-logic-java icon indicating copy to clipboard operation
json-logic-java copied to clipboard

Round off error in Floating-point calculations

Open biswajit-togai opened this issue 3 years ago • 0 comments

Calculations involving high precision floating point operations are returning incorrect results.

For example:

String json = "{\"*\": [0.1, 0.1]}";
Object result = jsonLogic.apply(json, null);

This will return 0.010000000000000002 rather than 0.01

biswajit-togai avatar Aug 17 '22 10:08 biswajit-togai