Skip to content
  • Johan Kiviniemi's avatar
    mkStdGen32: Avoid infinite recursion when applied to minBound · d8e406fd
    Johan Kiviniemi authored
    "mkStdGen32 s" would call itself with "negate s" if "s" is negative. Alas,
    (minBound :: Int32) == negate minBound. "mkStdGen32 minBound" would thus
    recurse infinitely.
    
    Compute "sMaybeNegative .&. maxBound" instead. That clears the most significant
    bit in signed types.
    d8e406fd