Haskell Core Libraries (base package)ParentContentsIndex
Data.Ratio
Portability portable
Stability provisional
Maintainer libraries@haskell.org
Description
Standard functions on rational numbers
Synopsis
data Ratio a
type Rational = Ratio Integer
(%) :: (Integral a) => a -> a -> Ratio a
numerator :: (Integral a) => Ratio a -> a
denominator :: (Integral a) => Ratio a -> a
approxRational :: (RealFrac a) => a -> a -> Rational
Documentation
data Ratio a
Instances
(Integral a, Read a) => Read (Ratio a)
(Integral a) => Ord (Ratio a)
(Integral a) => Num (Ratio a)
(Integral a) => Fractional (Ratio a)
(Integral a) => Real (Ratio a)
(Integral a) => RealFrac (Ratio a)
(Integral a) => Show (Ratio a)
(Integral a) => Enum (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.
(%) :: (Integral a) => a -> a -> Ratio a
numerator :: (Integral a) => Ratio a -> a
denominator :: (Integral a) => Ratio a -> a
approxRational :: (RealFrac a) => a -> a -> Rational
Produced by Haddock version 0.3