You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contrary to what I said in #760, it is safely possible to generate random floats between 0 and 1 (not including 1) in userland for 64 bit systems, by using the following construction:
random_int(0, (1 << 53) - 1) / (1 << 53)
(which is equivalent to PHP 8.3's Randomizer::nextFloat() or Randomizer::getFloat(0, 1))
This can be leveraged to generate a boolean with a specific non-integer chance as follows: