haskell-mpfr-0.1: Correctly-rounded arbitrary-precision floating-point arithmetic

Safe HaskellNone
LanguageHaskell2010

Data.Approximate.MPFRLowLevel

Contents

Synopsis

Types

data RoundMode Source

Constructors

Near 
Zero 
Up 
Down 
AwayFromZero 

Instances

Enum RoundMode 

type Precision = Int Source

data Rounded Source

Instances

Eq Rounded 
Ord Rounded 
Show Rounded 

Assignment functions

fromDouble :: RoundMode -> Precision -> Double -> Rounded Source

Construct a rounded floating point number directly from a Double.

fromInteger2Exp :: RoundMode -> Precision -> Integer -> Int -> Rounded Source

Conversion functions

toRationalA :: Rounded -> Rational Source

toDouble2Exp :: RoundMode -> Rounded -> (Double, Int) Source

toInteger2Exp :: Rounded -> (Integer, Int) Source

toRawStringExp :: RoundMode -> Int -> Int -> Rounded -> (String, Exp) Source

toStringHex :: RoundMode -> Int -> Rounded -> String Source

toStringBin :: RoundMode -> Int -> Rounded -> String Source

toStringSci :: RoundMode -> Int -> Rounded -> String Source

toStringFix :: RoundMode -> Int -> Rounded -> String Source

toString :: RoundMode -> Int -> Rounded -> String Source

Arithmetic functions

Comparison functions

isNaN :: Rounded -> Bool Source

isZero :: Rounded -> Bool Source

cmp :: Rounded -> Rounded -> Maybe Ordering Source

cmpAbs :: Rounded -> Rounded -> Maybe Ordering Source

sgn :: Rounded -> Maybe Int Source

equal :: Rounded -> Rounded -> Bool Source

less :: Rounded -> Rounded -> Bool Source

Special functions

Integer functions

Miscellaneous functions