Hoogle Search
Within LTS Haskell 24.49 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
safe-decimal Numeric.Decimal Convert a bounded integeral into a decimal, while performing the necessary scaling
>>> import Numeric.Decimal >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int) 1234.0000 >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int16) *** Exception: arithmetic overflow
-
safe-decimal Numeric.Decimal No documentation available.
-
safe-decimal Numeric.Decimal Convert a Rational to a bounded Decimal, but only if there is no precision loss or Overflow/Undeflow.
-
safe-decimal Numeric.Decimal Convert from Scientific to bounded Decimal while checking for Overflow/Underflow
-
safe-decimal Numeric.Decimal Convert a decimal backed by an integral to another decimal backed by a bounded integeral, while checking for Overflow/Underflow
>>> import Numeric.Decimal >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int) 1234.0000 >>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int16) *** Exception: arithmetic overflow
-
safe-decimal Numeric.Decimal Subtract two decimal numbers.
-
safe-decimal Numeric.Decimal No documentation available.
-
safe-decimal Numeric.Decimal Add two decimal numbers.
-
safe-decimal Numeric.Decimal Multiply all decimal numbers in the list while doing rounding.
>>> :set -XDataKinds >>> product [1.1, 20.02, 300.003] :: Double 6606.666066000001 >>> xs <- arithM (mapM fromRational [1.1, 20.02, 300.003] :: Arith [Decimal RoundHalfUp 4 Int]) >>> xs [1.1000,20.0200,300.0030] >>> productDecimalBoundedWithRounding xs 6606.6661
-
safe-decimal Numeric.Decimal No documentation available.