fix random()
This commit is contained in:
@@ -279,8 +279,9 @@ var HEADER = Symbol()
|
||||
|
||||
// returns a number between 0 and 1. There is a 50% chance that the result is less than 0.5.
|
||||
$_.random = function() {
|
||||
var n = os.random()
|
||||
return n > 100000
|
||||
// os.random() returns a 53-bit integer (uint64 >> 11)
|
||||
// Divide by 2^53 to get a value in [0, 1)
|
||||
return (os.random() / 9007199254740992)
|
||||
}
|
||||
|
||||
$_.random_fit = os.random
|
||||
|
||||
Reference in New Issue
Block a user