Skip to content

Make fromInteger use round-to-nearest-even for Float and Double

arata, mizuki requested to merge aratamizuki/ghc:frominteger-rounding into master

This change makes fromInteger :: Integer -> {Float,Double} use round-to-nearest-even mode.

Fixes #15926 (closed), #17231 (closed), #17782 (closed).

A few concerns:

  • integerToFloat# and integerToDouble# were moved from GHC.Num.Integer (ghc-bignum) to GHC.Float (base).
  • GHC/Float.hs-boot was added to keep GHC.Integer.floatFromInteger/doubleFromInteger. Is this okay? Or should I just remove floatFromInteger and doubleFromInteger? GHC.Integer.floatFromInteger and doubleFromInteger were removed.
Edited by arata, mizuki

Merge request reports