X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FBase.lhs;h=a95d19d7faec5e98023b83b893d5335e1b727de9;hb=4ef39162b8ae3ab239009e6386b5787475f172d9;hp=4fc09a6e73c693243f33b14088b6574c5135a9ef;hpb=c96135409f18fa1b2efd5fa04a4709b27d1e8774;p=ghc-base.git diff --git a/GHC/Base.lhs b/GHC/Base.lhs index 4fc09a6..a95d19d 100644 --- a/GHC/Base.lhs +++ b/GHC/Base.lhs @@ -63,6 +63,7 @@ Other Prelude modules are much easier with fewer complex dependencies. \begin{code} {-# OPTIONS_GHC -fno-implicit-prelude #-} +{-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Base @@ -496,7 +497,6 @@ otherwise :: Bool otherwise = True \end{code} - %********************************************************* %* * \subsection{The @()@ type} @@ -731,12 +731,6 @@ breakpoint r = r breakpointCond :: Bool -> a -> a breakpointCond _ r = r -data Unknown -data Unknown1 a -data Unknown2 a b -data Unknown3 a b c -data Unknown4 a b c d - data Opaque = forall a. O a -- | Constant function. @@ -926,14 +920,26 @@ gtInt, geInt, eqInt, neInt, ltInt, leInt :: Int -> Int -> Bool "plusDouble x 0.0" forall x#. (+##) x# 0.0## = x# "plusDouble 0.0 x" forall x#. (+##) 0.0## x# = x# "minusDouble x 0.0" forall x#. (-##) x# 0.0## = x# -"minusDouble x x" forall x#. (-##) x# x# = 0.0## -"timesDouble x 0.0" forall x#. (*##) x# 0.0## = 0.0## -"timesDouble 0.0 x" forall x#. (*##) 0.0## x# = 0.0## "timesDouble x 1.0" forall x#. (*##) x# 1.0## = x# "timesDouble 1.0 x" forall x#. (*##) 1.0## x# = x# "divideDouble x 1.0" forall x#. (/##) x# 1.0## = x# #-} +{- +We'd like to have more rules, but for example: + +This gives wrong answer (0) for NaN - NaN (should be NaN): + "minusDouble x x" forall x#. (-##) x# x# = 0.0## + +This gives wrong answer (0) for 0 * NaN (should be NaN): + "timesDouble 0.0 x" forall x#. (*##) 0.0## x# = 0.0## + +This gives wrong answer (0) for NaN * 0 (should be NaN): + "timesDouble x 0.0" forall x#. (*##) x# 0.0## = 0.0## + +These are tested by num014. +-} + -- Wrappers for the shift operations. The uncheckedShift# family are -- undefined when the amount being shifted by is greater than the size -- in bits of Int#, so these wrappers perform a check and return