X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fstd%2FNumeric.lhs;h=ac2a037402eafb27dc8ea1bf3fae0f775d464e25;hb=e921b2e307532e0f30eefa88b11a124be592bde4;hp=fa56105a824e94f43b234f51da5c3c91b76b9800;hpb=f7989a6dea8c43352f363117d9bb07439953ccdc;p=ghc-hetmet.git diff --git a/ghc/lib/std/Numeric.lhs b/ghc/lib/std/Numeric.lhs index fa56105..ac2a037 100644 --- a/ghc/lib/std/Numeric.lhs +++ b/ghc/lib/std/Numeric.lhs @@ -8,7 +8,6 @@ Odds and ends, mostly functions for reading and showing \begin{code} -{-# OPTIONS -fno-implicit-prelude #-} module Numeric ( fromRat -- :: (RealFloat a) => Rational -> a @@ -34,23 +33,27 @@ module Numeric -- Implementation checked wrt. Haskell 98 lib report, 1/99. ) where +import Char + #ifndef __HUGS__ -import PrelBase -import PrelMaybe -import PrelShow -import PrelArr -import PrelNum -import PrelNumExtra -import PrelRead -import PrelErr ( error ) + -- GHC imports +import Prelude -- For dependencies +import PrelBase ( Char(..) ) +import PrelRead -- Lots of things +import PrelReal ( showSigned ) +import PrelFloat ( fromRat, FFFormat(..), + formatRealFloat, floatToDigits, showFloat + ) +import PrelNum ( ord_0 ) #else -import Char + -- Hugs imports import Array #endif -\end{code} #ifndef __HUGS__ +\end{code} + \begin{code} showInt :: Integral a => a -> ShowS showInt i rs @@ -82,7 +85,15 @@ showGFloat d x = showString (formatRealFloat FFGeneric d x) \end{code} -#else +#else + +%********************************************************* +%* * + All of this code is for Hugs only + GHC gets it from PrelFloat! +%* * +%********************************************************* + \begin{code} -- This converts a rational to a floating. This should be used in the -- Fractional instances of Float and Double.