[project @ 2002-06-18 09:31:05 by simonpj]
[ghc-base.git] / GHC / Real.lhs
index 13be142..be30073 100644 (file)
@@ -41,6 +41,13 @@ default ()           -- Double isn't available yet,
 \begin{code}
 data  (Integral a)     => Ratio a = !a :% !a  deriving (Eq)
 type  Rational         =  Ratio Integer
+
+infinity, notANumber :: Rational
+infinity   = 1 :% 0
+notANumber = 0 :% 0
+
+-- Use :%, not % for Inf/NaN; the latter would 
+-- immediately lead to a runtime error, because it normalises. 
 \end{code}