Can anyone answer me why javascript adds up 1.123460 + 0.112210 as 1.2356699999999998 while no way I can come up with that result by manual calculation or by any other compilers.. Am I going crazy or javascript, cannot figure out
Asked
Active
Viewed 85 times
-1
-
https://stackoverflow.com/q/1458633/1542290 ? – Mr. Alien May 30 '17 at 06:01
1 Answers
0
Its just how JavaScript and many other languages deal with floats. Rounding them to 15 decimal places. Check this How to deal with floating point number precision in JavaScript? How to deal with floating point number precision in JavaScript?