posted 23 years ago
Well, when the digit left of the decimal point is greater or equal to 5, the floating number is rounded to the next greater integer.
For instance,
Math.round(3.5) will return 4. Similarly, with negative floating numbers, such as -3.5, Math.round(-3.5) will return the next greater integer, which is -3.