Akos Kiss b31074cc6b Ensure that Math.random() really covers [0,1) interval (#1417)
Legacy implementation made incorrect assumptions on how many bits
of useful information is returned by libc's `rand()`. If `RAND_MAX`
had more than 16 useful bits, it assumed that `rand()` could return
32 useful random bits. However, e.g., jerry-libc's `RAND_MAX` is
`0x7fffffff`, which denotes 31 useful bits only. The consequence
was that `Math.random()` covered only the lower half of the
standard-mandated `[0,1)` interval.

This path fixes the error and always uses the exact value of
`RAND_MAX` to compute the random value, which will thus fully cover
`[0,1)`.

Fixes #1414

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-11-01 15:43:16 +01:00
..
2016-08-05 09:11:33 +02:00
2016-08-05 09:11:33 +02:00
2016-08-05 09:11:33 +02:00
2016-08-05 09:11:33 +02:00
2016-08-05 09:11:33 +02:00
2016-08-05 09:11:33 +02:00