Quote:
Originally Posted by Krupski
I do need parseInt because the algorithm depends on integer math and indeed fails if floating point numbers get involved.
|
but parseInt() in JavaScript doesn't convert the values to integers, it converts between number bases eg base 16 to base 10
Math.floor() is the JavaScript function to convert from a float to an integer.