From cc08cdd4736f79f4eb4c0f2d7806283fcb3dc60c Mon Sep 17 00:00:00 2001 From: Michael Lan Date: Tue, 30 Aug 2022 16:46:16 -0700 Subject: [PATCH] fix: normal form on rational constructor --- src/Data/BigDecimal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/BigDecimal.hs b/src/Data/BigDecimal.hs index a1bbc0b..ea284d6 100644 --- a/src/Data/BigDecimal.hs +++ b/src/Data/BigDecimal.hs @@ -116,7 +116,7 @@ instance Fractional BigDecimal where -- | creates a BigDecimal from a 'Rational' value. 'RoundingAdvice' defines precision and rounding mode. fromRatio :: Rational -> RoundingAdvice -> BigDecimal -fromRatio (x :% y) = divide (fromInteger x, fromInteger y) +fromRatio (x :% y) = nf . divide (fromInteger x, fromInteger y) instance Real BigDecimal where toRational (BigDecimal val scl) = toRational val * 10 ^^ (- fromNatural scl)