From 2ab51a5348c3b24f328bc40b0c4f0fb8cf0a5415 Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 1 Nov 1999 10:16:03 +0000 Subject: [PATCH] [project @ 1999-11-01 10:16:03 by sof] formatRealFloat: Fixed some e==0 confusion in the default case for FFExponent --- ghc/lib/std/PrelNumExtra.lhs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 1.7.10.4