posted 17 years ago
Math.round is calculated as below
1. add 0.5 to the number
2. then,take the floor of it.
Eg 1: 2.4
1. 2.9
2. Floor(2.9) = 2 (not 2.0, since round returns either long or int).
Eg 2: -2.4
1. -1.9
2. floor(-1.9) = -2
point of note: floor of negative number is equivalent to ciel of its positive number.