document.writeln(Math.floor(43.9)); produces 43 in the browser.
document.writeln(Math.floor(43.9999)); produces 43
document.writeln(Math.floor(43.999999999999)); again 43
However,
document.writeln(Math.floor(43.99999999999999)); produces 44.
The magic number of 9's after the decimal point seems to be 15*.
Why is this?
Furthermore, Does the Math.floor function accept the number as a number object, or a number value?
0.1 + 0.2 !== 0.3, right?:)Your observation is probably a variation on the theme.