|
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 |
|
class (Num a) => Fractional a where | | | class (Real a, Enum a) => Integral a where | | | data Ratio a = (:%) !a !a | | type Rational = Ratio Integer | | class (Num a, Ord a) => Real a where | | | class (Real a, Fractional a) => RealFrac a where | | | class (Real a, Fractional a) => RealFrac a where | | | denominator :: (Integral a) => Ratio a -> a | | class (Real a, Enum a) => Integral a where | | | class (Real a, Enum a) => Integral a where | | | even :: (Integral a) => a -> Bool | | class (Real a, Fractional a) => RealFrac a where | | | fromIntegral :: (Integral a, Num b) => a -> b | | class (Num a) => Fractional a where | | | gcd :: (Integral a) => a -> a -> a | | infinity :: Rational | | integralEnumFrom :: (Integral a, Bounded a) => a -> [a] | | integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a] | | integralEnumFromThenTo :: (Integral a) => a -> a -> a -> [a] | | integralEnumFromTo :: (Integral a) => a -> a -> [a] | | lcm :: (Integral a) => a -> a -> a | | class (Real a, Enum a) => Integral a where | | | notANumber :: Rational | | numerator :: (Integral a) => Ratio a -> a | | numericEnumFrom :: (Fractional a) => a -> [a] | | numericEnumFromThen :: (Fractional a) => a -> a -> [a] | | numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a] | | numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a] | | odd :: (Integral a) => a -> Bool | | class (Real a, Fractional a) => RealFrac a where | | | class (Real a, Enum a) => Integral a where | | | class (Real a, Enum a) => Integral a where | | | ratio_prec :: Int | | realToFrac :: (Real a, Fractional b) => a -> b | | class (Num a) => Fractional a where | | | reduce :: (Integral a) => a -> a -> Ratio a | | class (Real a, Enum a) => Integral a where | | | class (Real a, Fractional a) => RealFrac a where | | | showSigned :: (Real a) => (a -> ShowS) -> Int -> a -> ShowS | | class (Real a, Enum a) => Integral a where | | | class (Num a, Ord a) => Real a where | | | class (Real a, Fractional a) => RealFrac a where | | | (%) :: (Integral a) => a -> a -> Ratio a | | class (Num a) => Fractional a where | | | data Ratio a = (:%) !a !a | | (^) :: (Num a, Integral b) => a -> b -> a | | (^^) :: (Fractional a, Integral b) => a -> b -> a |
|
|
Documentation |
|
class (Num a) => Fractional a where |
| Methods | fromRational :: Rational -> a | | recip :: a -> a | | (/) :: a -> a -> a |
| | Instances | |
|
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
| | Instances | |
|
|
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. |
|
class (Num a, Ord a) => Real a where |
|
|
class (Real a, Fractional a) => RealFrac a where |
|
|
class (Real a, Fractional a) => RealFrac a where |
|
|
denominator :: (Integral a) => Ratio a -> a |
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
even :: (Integral a) => a -> Bool |
|
class (Real a, Fractional a) => RealFrac a where |
|
|
fromIntegral :: (Integral a, Num b) => a -> b |
|
class (Num a) => Fractional a where |
| Methods | fromRational :: Rational -> a | | recip :: a -> a | | (/) :: a -> a -> a |
|
|
|
gcd :: (Integral a) => a -> a -> a |
|
infinity :: Rational |
|
integralEnumFrom :: (Integral a, Bounded a) => a -> [a] |
|
integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a] |
|
integralEnumFromThenTo :: (Integral a) => a -> a -> a -> [a] |
|
integralEnumFromTo :: (Integral a) => a -> a -> [a] |
|
lcm :: (Integral a) => a -> a -> a |
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
notANumber :: Rational |
|
numerator :: (Integral a) => Ratio a -> a |
|
numericEnumFrom :: (Fractional a) => a -> [a] |
|
numericEnumFromThen :: (Fractional a) => a -> a -> [a] |
|
numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a] |
|
numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a] |
|
odd :: (Integral a) => a -> Bool |
|
class (Real a, Fractional a) => RealFrac a where |
|
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
ratio_prec :: Int |
|
realToFrac :: (Real a, Fractional b) => a -> b |
|
class (Num a) => Fractional a where |
| Methods | fromRational :: Rational -> a | | recip :: a -> a | | (/) :: a -> a -> a |
|
|
|
reduce :: (Integral a) => a -> a -> Ratio a |
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
class (Real a, Fractional a) => RealFrac a where |
|
|
showSigned :: (Real a) => (a -> ShowS) -> Int -> a -> ShowS |
|
class (Real a, Enum a) => Integral a where |
| Methods | toInteger :: a -> Integer | | quotRem :: a -> a -> (a, a) | | divMod :: a -> a -> (a, a) | | quot :: a -> a -> a | | rem :: a -> a -> a | | div :: a -> a -> a | | mod :: a -> a -> a |
|
|
|
class (Num a, Ord a) => Real a where |
|
|
class (Real a, Fractional a) => RealFrac a where |
|
|
(%) :: (Integral a) => a -> a -> Ratio a |
|
class (Num a) => Fractional a where |
| Methods | fromRational :: Rational -> a | | recip :: a -> a | | (/) :: a -> a -> a |
|
|
|
data Ratio a |
|
|
(^) :: (Num a, Integral b) => a -> b -> a |
|
(^^) :: (Fractional a, Integral b) => a -> b -> a |
|
Produced by Haddock version 0.3 |