[SR-11447] Infinite loop in RandomNumberGenerator using drand48 #53848
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Xcode 10.3 (10G8)
Swift 5.0.1
Additional Detail from JIRA
md5: 71caa2ca8b9939510bf7e4ee0645d128
Issue Description:
A simple implementation of
RandomNumberGenerator
usingdrand48
results in infinite calls tonext()
when used to find a random 8- or 16-bit Int or UInt.This issue does not occur with other simple implementations, e.g. using
arc4random
, nor if it's used to find a random 32- or 64-bit Int or UInt.The range passed to the
random
method doesn't seem to have any impact.Uncomment lines below to see an example.
The text was updated successfully, but these errors were encountered: