|
GHC.Real | Portability | non-portable (GHC Extensions) | Stability | internal | Maintainer | cvs-ghc@haskell.org |
|
|
|
|
|
Description |
The types Ratio and Rational, and the classes Real, Fractional,
Integral, and RealFrac.
|
|
Synopsis |
|
data Ratio a = (:%) !a !a | | type Rational = Ratio Integer | | ratioPrec :: Int | | ratioPrec1 :: Int | | infinity :: Rational | | notANumber :: Rational | | (%) :: (Integral a) => a -> a -> Ratio a | | numerator :: (Integral a) => Ratio a -> a | | denominator :: (Integral a) => Ratio a -> a | | reduce :: (Integral a) => a -> a -> Ratio a | | class (Num a, Ord a) => Real a where | | | class (Real a, Enum a) => Integral a where | | | class (Num a) => Fractional a where | | | class (Real a, Fractional a) => RealFrac a where | | | numericEnumFrom :: (Fractional a) => a -> [a] | | numericEnumFromThen :: (Fractional a) => a -> a -> [a] | | numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a] | | numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a] | | fromIntegral :: (Integral a, Num b) => a -> b | | realToFrac :: (Real a, Fractional b) => a -> b | | showSigned :: (Real a) => (a -> ShowS) -> Int -> a -> ShowS | | even :: (Integral a) => a -> Bool | | odd :: (Integral a) => a -> Bool | | (^) :: (Num a, Integral b) => a -> b -> a | | (^^) :: (Fractional a, Integral b) => a -> b -> a | | gcd :: (Integral a) => a -> a -> a | | lcm :: (Integral a) => a -> a -> a | | integralEnumFrom :: (Integral a, Bounded a) => a -> [a] | | integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a] | | integralEnumFromTo :: (Integral a) => a -> a -> [a] | | integralEnumFromThenTo :: (Integral a) => a -> a -> a -> [a] |
|
|
Documentation |
|
data Ratio a |
|
|
type Rational = Ratio Integer |
Arbitrary-precision rational numbers, represented as a ratio of
two Integer values. A rational number may be constructed using
the % operator. |
|
ratioPrec :: Int |
|
ratioPrec1 :: Int |
|
infinity :: Rational |
|
notANumber :: Rational |
|
(%) :: (Integral a) => a -> a -> Ratio a |
|
numerator :: (Integral a) => Ratio a -> a |
|
denominator :: (Integral a) => Ratio a -> a |
|
reduce :: (Integral a) => a -> a -> Ratio a |
|
class (Num a, Ord a) => Real a where |
|
|
class (Real a, Enum a) => Integral a where |
| Methods | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | toInteger :: a -> Integer |
| | Instances | |
|
|
class (Num a) => Fractional a where |
| Methods | (/) :: a -> a -> a | | recip :: a -> a | | fromRational :: Rational -> a |
| | Instances | |
|
|
class (Real a, Fractional a) => RealFrac a where |
|
|
numericEnumFrom :: (Fractional a) => a -> [a] |
|
numericEnumFromThen :: (Fractional a) => a -> a -> [a] |
|
numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a] |
|
numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a] |
|
fromIntegral :: (Integral a, Num b) => a -> b |
|
realToFrac :: (Real a, Fractional b) => a -> b |
|
showSigned :: (Real a) => (a -> ShowS) -> Int -> a -> ShowS |
|
even :: (Integral a) => a -> Bool |
|
odd :: (Integral a) => a -> Bool |
|
(^) :: (Num a, Integral b) => a -> b -> a |
|
(^^) :: (Fractional a, Integral b) => a -> b -> a |
|
gcd :: (Integral a) => a -> a -> a |
|
lcm :: (Integral a) => a -> a -> a |
|
integralEnumFrom :: (Integral a, Bounded a) => a -> [a] |
|
integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a] |
|
integralEnumFromTo :: (Integral a) => a -> a -> [a] |
|
integralEnumFromThenTo :: (Integral a) => a -> a -> a -> [a] |
|
Produced by Haddock version 0.4 |