base: Fix handling of showEFloat (Just 0)
authorBen Gamari <bgamari.foss@gmail.com>
Sun, 13 May 2018 15:40:18 +0000 (11:40 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 13 May 2018 22:30:43 +0000 (18:30 -0400)
commit9039f847a568ac69436d449b9fe090ecd03b9e06
tree91ad1495e541e7025c7a1501097c5e114d15153d
parent6ab7cf995dafcc9196e87bbde76b4f6937507592
base: Fix handling of showEFloat (Just 0)

Previously `showEFloat (Just 0) pi ""` would produce `3.0e0`. Of
course, this
blatantly disrespects the user's request to print with zero digits of
precision.
Fix this.

This is tested by base's `num008` testcase.

Test Plan: Validate

Reviewers: hvr

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15115

Differential Revision: https://phabricator.haskell.org/D4665
libraries/base/GHC/Float.hs
libraries/base/changelog.md
libraries/base/tests/Numeric/num008.stdout