summaryrefslogtreecommitdiff
path: root/libraries/ghc-bignum
diff options
context:
space:
mode:
authorARATA Mizuki <minorinoki@gmail.com>2021-01-14 22:58:45 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-17 19:05:13 -0400
commit540fa6b2cff3802877ff56a47ab3611e33a9ac86 (patch)
tree3cb8a8448170e96ec1d0fadee138cd6a4e58249b /libraries/ghc-bignum
parentf11954b16c07703b5444eda4a8ab16eadaedc7e6 (diff)
downloadhaskell-540fa6b2cff3802877ff56a47ab3611e33a9ac86.tar.gz
fromInteger :: Integer -> {Float,Double} now always round to nearest even
integerToFloat# and integerToDouble# were moved from ghc-bignum to base. GHC.Integer.floatFromInteger and doubleFromInteger were removed. Fixes #15926, #17231, #17782
Diffstat (limited to 'libraries/ghc-bignum')
-rw-r--r--libraries/ghc-bignum/src/GHC/Num/Integer.hs11
1 files changed, 0 insertions, 11 deletions
diff --git a/libraries/ghc-bignum/src/GHC/Num/Integer.hs b/libraries/ghc-bignum/src/GHC/Num/Integer.hs
index ae0d6af20b..6334e1636f 100644
--- a/libraries/ghc-bignum/src/GHC/Num/Integer.hs
+++ b/libraries/ghc-bignum/src/GHC/Num/Integer.hs
@@ -1084,22 +1084,11 @@ integerEncodeDouble# (IN b) e = negateDouble# (bigNatEncodeDouble# b e)
integerEncodeDouble :: Integer -> Int -> Double
integerEncodeDouble !m (I# e) = D# (integerEncodeDouble# m e)
--- | Encode an Integer (mantissa) into a Double#
-integerToDouble# :: Integer -> Double#
-{-# NOINLINE integerToDouble# #-}
-integerToDouble# !i = integerEncodeDouble# i 0#
-
--- | Encode an Integer (mantissa) into a Float#
-integerToFloat# :: Integer -> Float#
-{-# NOINLINE integerToFloat# #-}
-integerToFloat# !i = integerEncodeFloat# i 0#
-
-- | Encode (# Integer mantissa, Int# exponent #) into a Float#
--
-- TODO: Not sure if it's worth to write 'Float' optimized versions here
integerEncodeFloat# :: Integer -> Int# -> Float#
{-# NOINLINE integerEncodeFloat# #-}
-integerEncodeFloat# !m 0# = double2Float# (integerToDouble# m)
integerEncodeFloat# !m e = double2Float# (integerEncodeDouble# m e)
-- | Compute the number of digits of the Integer (without the sign) in the given base.