b31074cc6b
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