I came across some code today:
console.log(Math.ceil(3.000000000000001))
--> 4
console.log(Math.ceil(3.0000000000000001))
--> 3
What happened in the JS interpreter? What rules is it following such that the 1 gets "trimmed" in the second Math.ceil
?
What I don't want is a bunch of links to floating point arithmetic... but what specifically is interpreted by JS.