License | MIT |
---|---|
Maintainer | douglas.mcclean@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
This type is sufficient to exactly express the closure of Q ∪ {π} under multiplication and division.
As a result it is useful for representing conversion factors
between physical units. Approximate values are included both to close the remainder
of the arithmetic operations in the Num
typeclass and to encode conversion
factors defined experimentally.
- data ExactPi
- = Exact Integer Rational
- | Approximate (forall a. Floating a => a)
- approximateValue :: Floating a => ExactPi -> a
- isExactZero :: ExactPi -> Bool
- isExactOne :: ExactPi -> Bool
Documentation
Represents an exact or approximate real value. The exactly representable values are rational multiples of an integer power of pi.
approximateValue :: Floating a => ExactPi -> a Source
isExactZero :: ExactPi -> Bool Source
Identifies whether an ExactPi
is an exact representation of zero.
isExactOne :: ExactPi -> Bool Source
Identifies whether an ExactPi
is an exact representation of one.