From: sof Date: Mon, 1 Nov 1999 10:16:03 +0000 (+0000) Subject: [project @ 1999-11-01 10:16:03 by sof] X-Git-Tag: Approximately_9120_patches~5628 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2ab51a5348c3b24f328bc40b0c4f0fb8cf0a5415;p=ghc-hetmet.git [project @ 1999-11-01 10:16:03 by sof] formatRealFloat: Fixed some e==0 confusion in the default case for FFExponent --- diff --git a/ghc/lib/std/PrelNumExtra.lhs b/ghc/lib/std/PrelNumExtra.lhs index b2bb638..c96617f 100644 --- a/ghc/lib/std/PrelNumExtra.lhs +++ b/ghc/lib/std/PrelNumExtra.lhs @@ -751,10 +751,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