You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the result shown 4.699999999999999 (the expected result 4.7)
Steps to reproduce (in JavaScript code):
calc.calx ('calculate', "2.3 + 2.4") // returns 4.699999999999999 (instead of 4.7)
I personally use it in a validation and I can not use it with the Excel ROUND function because the formulas are created by the users.
e.g. IF (2.3 + 2.4 = 4.7, "correct", "incorrect") // returns "incorrect" (instead of "correct")
The text was updated successfully, but these errors were encountered:
I think it is the nature way dealing with floating point on most language, the only way to fix this is improve the comparator formula to deal with floating point comparison
Calculating 2.3 + 2.4 returns 4.699999999999999 instead of 4.7
About floating-point arithmetic operations go to:
http://floating-point-gui.de/
http://www.w3schools.com/js/js_numbers.asp
Steps to reproduce (on the demo web of calx2 jquery):
Steps to reproduce (in JavaScript code):
calc.calx ('calculate', "2.3 + 2.4") // returns 4.699999999999999 (instead of 4.7)
I personally use it in a validation and I can not use it with the Excel ROUND function because the formulas are created by the users.
e.g. IF (2.3 + 2.4 = 4.7, "correct", "incorrect") // returns "incorrect" (instead of "correct")
The text was updated successfully, but these errors were encountered: