Safe Haskell | None |
---|---|
Language | Haskell98 |
Documentation
class (C a, C a, Ord a) => C a where Source #
This class allows lossless conversion
from any representation of a rational to the fixed Rational
type.
"Lossless" means - don't do any rounding.
For rounding see Algebra.RealRing.
With the instances for Float
and Double
we acknowledge that these types actually represent rationals
rather than (approximated) real numbers.
However, this contradicts to the Transcendental
class.
Laws that must be satisfied by instances:
fromRational' . toRational === id
toRational :: a -> Rational Source #
Lossless conversion from any representation of a rational to Rational
C Double Source # | |
C Float Source # | |
C Int Source # | |
C Int8 Source # | |
C Int16 Source # | |
C Int32 Source # | |
C Int64 Source # | |
C Integer Source # | |
C Word Source # | |
C Word8 Source # | |
C Word16 Source # | |
C Word32 Source # | |
C Word64 Source # | |
C T Source # | |
Real a => C (T a) Source # | |
(C a, C a) => C (T a) Source # | |
C a => C (T a) Source # | |