scientific 0.0.0.0 → 0.0.0.1
raw patch · 2 files changed
+3/−3 lines, 2 files
Files
- scientific.cabal +1/−1
- src/Data/Scientific.hs +2/−2
scientific.cabal view
@@ -1,5 +1,5 @@ name: scientific-version: 0.0.0.0+version: 0.0.0.1 synopsis: Arbitrary-precision floating-point numbers represented using scientific notation description: A @Scientific@ number is an arbitrary-precision floating-point number represented using scientific notation.
src/Data/Scientific.hs view
@@ -88,7 +88,7 @@ hashWithSalt salt = hashWithSalt salt . toRational instance Show Scientific where- showsPrec _ = showString . formatScientific Generic Nothing+ show = formatScientific Generic Nothing instance Read Scientific where readPrec = ReadPrec.lift scientificP@@ -308,7 +308,7 @@ fromRealFloat rf -- integers are way more efficient to convert via Rational. -- We do pay the cost of always converting to Rational first though.- | denominator rat == 1 = fromRational rat+ | denominator rat == 1 = fromInteger $ numerator rat | rf < 0 = negate $ fromNonNegRealFloat $ negate rf | otherwise = fromNonNegRealFloat rf where