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-09-09 01:49:57 -07:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-10-19 15:36:15 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-10-19 15:36:15 +02:00
2016-08-05 09:11:33 +02:00
2016-10-19 15:36:15 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-10-25 13:15:14 +02:00
2016-06-16 01:42:55 -07:00
2016-02-17 13:52:51 +00:00
2016-06-16 01:42:55 -07:00
2016-09-23 09:47:13 +02:00
2016-08-05 09:11:33 +02:00
2016-10-19 15:36:15 +02:00
2016-09-21 10:43:40 +02:00
2016-09-21 10:43:40 +02:00
2016-09-09 01:49:57 -07:00
2016-08-05 09:11:33 +02:00
2016-08-05 13:16:53 +02:00
2016-09-19 00:32:38 -07:00
2016-06-16 01:42:55 -07:00
2016-11-01 15:43:16 +01:00
2016-06-16 01:42:55 -07:00
2016-10-19 15:36:15 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-10-18 09:12:05 +02:00
2016-06-16 01:42:55 -07:00
2016-09-19 00:32:38 -07:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-10-19 15:36:15 +02:00
2016-08-05 09:11:33 +02:00
2016-10-19 15:36:15 +02:00
2016-06-16 01:42:55 -07:00
2016-10-27 12:47:54 +02:00
2016-08-05 09:11:33 +02:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-03-09 11:44:32 +01:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-08-05 09:11:33 +02:00
2016-06-16 01:42:55 -07:00
2016-06-21 06:12:17 -07:00
2016-10-19 15:36:15 +02:00
2016-08-01 04:25:32 -07:00
2016-10-19 15:36:15 +02:00