Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data Ratio a = !a :% !a
- reduce :: Integral a => Ratio a -> Ratio a
- shiftr :: Num a => a -> Ratio a -> Ratio a
- rati08 :: Conn k Rational (Extended Int8)
- rati16 :: Conn k Rational (Extended Int16)
- rati32 :: Conn k Rational (Extended Int32)
- rati64 :: Conn k Rational (Extended Int64)
- ratixx :: Conn k Rational (Extended Int)
- ratint :: Conn k Rational (Extended Integer)
- ratfix :: forall e k. HasResolution e => Conn k Rational (Extended (Fixed e))
- ratf32 :: Conn k Rational Float
- ratf64 :: Conn k Rational Double
- posw08 :: Conn k Positive (Lowered Word8)
- posw16 :: Conn k Positive (Lowered Word16)
- posw32 :: Conn k Positive (Lowered Word32)
- posw64 :: Conn k Positive (Lowered Word64)
- poswxx :: Conn k Positive (Lowered Word)
- posnat :: Conn k Positive (Lowered Natural)
Documentation
Rational numbers, with numerator and denominator of some Integral
type.
Note that Ratio
's instances inherit the deficiencies from the type
parameter's. For example, Ratio Natural
's Num
instance has similar
problems to Natural
's.
!a :% !a |
Instances
shiftr :: Num a => a -> Ratio a -> Ratio a Source #
Shift by n 'units of least precision' where the ULP is determined by the denominator
This is an analog of shift32
for rationals.