
29 Oct
2004
29 Oct
'04
1:22 p.m.
Double already has +Inf and -Inf; it's just that Haskell doesn't have (AFAIK) syntax to write them as constants.
In the source for the GHC libraries it uses 1/0 for +Infinity and -1/0 for -Infinity, so I assume these are the "official" way to do it. Personally I would define nicer names: positiveInfinity :: Double positiveInfinity = 1/0 negativeInfinity :: Double negativeInfinity = -1/0 Keean.