Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype DecimalFraction = DF Rational
- fromDouble :: Double -> DecimalFraction
- validDivisor :: DecimalFraction -> Bool
- digits :: DecimalFraction -> Int
Documentation
newtype DecimalFraction Source #
Data type for decimal fractions
Instances
fromDouble :: Double -> DecimalFraction Source #
Approximation of a double, with a precision of 8 digits
validDivisor :: DecimalFraction -> Bool Source #
Tests whether it is safe to divide by this fraction: it is safe to divide if its numerator(!) is a product of two's and five's.
digits :: DecimalFraction -> Int Source #
number of decimal digits