ratio-int-0.1.2: Fast specialisation of Data.Ratio for Int.

Safe HaskellSafe
LanguageHaskell98

Data.RatioInt

Description

Provides a specialised version of Ratio for Int.

Runs about ten times faster than Ratio while being half as fast as floating-point types.

Synopsis

Documentation

data RatioInt #

Rational numbers, with numerator and denominator of the Int type.

Instances

Enum RatioInt # 
Eq RatioInt # 
Fractional RatioInt # 
Num RatioInt # 
Ord RatioInt # 
Read RatioInt # 
Real RatioInt # 
RealFrac RatioInt # 

Methods

properFraction :: Integral b => RatioInt -> (b, RatioInt) #

truncate :: Integral b => RatioInt -> b #

round :: Integral b => RatioInt -> b #

ceiling :: Integral b => RatioInt -> b #

floor :: Integral b => RatioInt -> b #

Show RatioInt # 
Storable RatioInt # 

(%) :: Int -> Int -> RatioInt infixl 7 #

Forms the ratio of two Int numbers.