Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,8 @@
maxRealFloat :: RealFloat a => a -> a
maxRealFloat x = encodeFloat b (e-1) `asTypeOf` x where
b = floatRadix x - 1
(_,e) = floatRange x
infinity :: RealFloat a => a
infinity = if isInfinite inf then inf else maxRealFloat 1.0 where
inf = 1/0

View file

@ -0,0 +1,4 @@
*Main> infinity :: Float
Infinity
*Main> infinity :: Double
Infinity

View file

@ -0,0 +1,4 @@
Prelude> 1 / 0 :: Float
Infinity
Prelude> 1 / 0 :: Double
Infinity

View file

@ -0,0 +1,4 @@
Prelude> read "Infinity" :: Float
Infinity
Prelude> read "Infinity" :: Double
Infinity