T16617.hs 300 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
import GHC.Float

main :: IO ()
main = do
  -- As per #16617, Word32s should be non-negative
  print $ castFloatToWord32 (-1)
  print $ toInteger (castFloatToWord32 (-1)) > 0
  -- For completeness, so should Word64s
  print $ castDoubleToWord64 (-1)
  print $ toInteger (castDoubleToWord64 (-1)) > 0