[project @ 1999-12-20 10:34:27 by simonpj]
[ghc-hetmet.git] / ghc / lib / std / PrelNumExtra.lhs
index 9e870c0..c9fa3c5 100644 (file)
@@ -5,6 +5,7 @@
 \section[PrelNumExtra]{Module @PrelNumExtra@}
 
 \begin{code}
+{-# OPTIONS -fno-cpr-analyse #-}
 {-# OPTIONS -fno-implicit-prelude #-}
 {-# OPTIONS -H20m #-}
 
@@ -28,7 +29,7 @@ import Maybe          ( fromMaybe )
 import PrelArr         ( Array, array, (!) )
 import PrelIOBase      ( unsafePerformIO )
 import PrelCCall       ()      -- we need the definitions of CCallable and 
-                               -- CReturnable for the _ccall_s herein.
+                               -- CReturnable for the foreign calls herein.
 \end{code}
 
 %*********************************************************
@@ -751,10 +752,11 @@ formatRealFloat fmt decs x
      FFExponent ->
       case decs of
        Nothing ->
-        let e' = if e==0 then 0 else e-1 in
-       (case ds of
-          [d]     -> d : ".0e"
-         (d:ds') -> d : '.' : ds' ++ "e") ++ show e'
+        let show_e' = show (e-1) in
+       case ds of
+          "0"     -> "0.0e0"
+          [d]     -> d : ".0e" ++ show_e'
+         (d:ds') -> d : '.' : ds' ++ "e" ++ show_e'
        Just dec ->
         let dec' = max dec 1 in
         case is of