
12 Feb
2008
12 Feb
'08
6:49 p.m.
2008/2/12 Uwe Hollerbach
Well... I dunno. Looking at the source to GHC.Real, I see
infinity, notANumber :: Rational infinity = 1 :% 0 notANumber = 0 :% 0
This is actually the reason I imported GHC.Real, because just plain % normalizes the rational number it creates, and that barfs very quickly when the denominator is 0. But the values themselves look perfectly reasonable... no?
Ummm... I'm going to have to go with no. In particular we can't have signed infinity represented like this and maintain reasonable numeric laws: 1/0 = 1/(-0) = (-1)/0 Rationals are defined not to have a zero denomiator, so I'll bet in more than one place in Data.Ratio that assumption is made. Luke