Javascript

(ECMAScript)

Math

random() - 15.8.2.14

Returns a number value 0 ≤ x < 1

round(x) - 15.8.2.15

Round to closest integer.

Tie-breakers move towards +∞.

NaN, +∞ and -∞ return themselves.

0 < x < 0.5 returns +0

-0.5 < x < 0 returns -0