jamsesso / json-logic-java

A pure Java implementation of JsonLogic without using the Nashorn JS engine
MIT License
99 stars 50 forks source link

Round off error in Floating-point calculations #32

Closed biswajit-togai closed 1 year ago

biswajit-togai commented 2 years ago

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