X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Frequired%2FNumeric.lhs;h=e6c3f0e5df87634b86b49b240e69f182bd3289bc;hb=3dae85dff73fbab6785b1f9312a502ead12bf489;hp=2dd49a3cec1a6d79190f5581fb58018899f584ca;hpb=169b432a9074006c98caafa439900fa797e5ad25;p=ghc-hetmet.git diff --git a/ghc/lib/required/Numeric.lhs b/ghc/lib/required/Numeric.lhs index 2dd49a3..e6c3f0e 100644 --- a/ghc/lib/required/Numeric.lhs +++ b/ghc/lib/required/Numeric.lhs @@ -1,5 +1,5 @@ % -% (c) The AQUA Project, Glasgow University, 1997 +% (c) The AQUA Project, Glasgow University, 1997-98 % \section[Numeric]{Numeric interface} @@ -40,9 +40,9 @@ import PrelRead \end{code} %********************************************************* -%* * -\subsection{Signatures} -%* * +%* * +\subsection[Numeric-signatures]{Signatures} +%* * %********************************************************* Interface on offer: @@ -103,11 +103,9 @@ showHex n r = showString "0x" $ showIntAtBase 16 (toChrHex) n r where - toChrHex d = - if d < 10 then - chr (ord_0 + fromIntegral d) - else - chr (ord 'a' + fromIntegral (d - 10)) + toChrHex d + | d < 10 = chr (ord_0 + fromIntegral d) + | otherwise = chr (ord 'a' + fromIntegral (d - 10)) showOct :: Integral a => a -> ShowS showOct n r = @@ -117,6 +115,10 @@ showOct n r = \end{code} +Controlling the format and precision of floats. The code that +implements the formatting itself is in @PrelNum@ to avoid +mutual module deps. + \begin{code} showEFloat :: (RealFloat a) => Maybe Int -> a -> ShowS showFFloat :: (RealFloat a) => Maybe Int -> a -> ShowS @@ -127,6 +129,3 @@ showFFloat d x = showString (formatRealFloat FFFixed d x) showGFloat d x = showString (formatRealFloat FFGeneric d x) \end{code} - - -