Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype RealNumber (p :: Nat) = RealNumber Rational
- data AsFixed p
- asFixed :: KnownNat p => RealNumber p -> AsFixed (NatPrec p)
- toFixed :: KnownNat p => RealNumber p -> Fixed (NatPrec p)
- fromFixed :: KnownNat p => Fixed (NatPrec p) -> RealNumber p
Documentation
newtype RealNumber (p :: Nat) Source #
Real Numbers represented using Rational numbers. The number type itself is exact in the sense that we can represent any rational number.
The parameter, a natural number, represents the precision (in number of decimals behind the period) with which we display the numbers when printing them (using Show).
If the number cannot be displayed exactly a '~' is printed after the number.