`showEFloat` inconsistency introduced in base-4.12
While base-4.11 had a showEFloat
that behaved like
showEFloat (Just n) | n <= 0 == showEFloat (Just 1)
For non-positive values, base-4.12 introduced an unfortunate inconsistency:
showEFloat (Just n) | n < 0 == showEFloat (Just 1)
-- NB: *not* equivalent to showEFloat (Just 0)
e.g. now we have
showEFloat (Just 2) 1.0 "" == "1.00e0"
showEFloat (Just 1) 1.0 "" == "1.0e0"
showEFloat (Just 0) 1.0 "" == "1e0"
showEFloat (Just (-1)) 1.0 "" == "1.0e0"
showEFloat (Just (-2)) 1.0 "" == "1.0e0"
iow, negative n
s in the precision argument are now treated differently from (Just 0)
which is a source of subtle bugs for API consumers which assume showEFloat
to have "continuous total" (or rather, saturated subtraction) semantics for the precision argument.