Copyright | (c) Aleš Bizjak |
---|---|
License | BSD3 |
Maintainer | mikkonecny@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell98 |
This module exports a pure interface to the MPFR library functions. Functions
return new MPFR
structures instead of modifying existing ones and so all
functions which produce a new MPFR structure take one more parameter than
their original C
counterparts. This parameter, Precision
, is the precision
of the resulting MPFR
.
This is naturally slower than modifying in-place, especially when dealing with lower precisions, so a "mutable" interface is provided in Data.Number.MPFR.Mutable module.
Naming conventions
- functions ending with _ (underscore) usually return a pair
(
, whereMPFR
,Int
)Int
is a return value of a correspondingmpfr_
function. See the MPFR manual for a description of return values. - the same functions without the _ return just the
MPFR
. mpfr_
prefix in functions is removed_ui
andui_
in function becomesw
(stands forWord
). For examplempfr_sub_ui
becomes
andsubw
mpfr_ui_sub
becomeswsub
.si_
and_si
in functions becomesi
(stands forInt
). For examplempfr_sub_si
becomes
andsubi
mpfr_si_sub
becomesisub
.- comparison functions which have
_p
appended loose it. For examplempfr_less_p
becomes
.less
Instances
- compare NaN _ =
GT
- compare _ NaN =
GT
- infinity < _ =
False
- -infinity > _ =
False
- NaN [<,>,>=,<=] _ =
False
This mimics the behaviour of built in Haskell Float
and Double
.
If you need instances of numeric typeclasses import one of the Data.Number.MPFR.Instances.* modules.
- data RoundMode
- data MPFR
- data Precision
- type Exp = Int64
- type MpSize = Int64
- module Data.Number.MPFR.Assignment
- module Data.Number.MPFR.Conversion
- module Data.Number.MPFR.Arithmetic
- module Data.Number.MPFR.Comparison
- module Data.Number.MPFR.Special
- module Data.Number.MPFR.Integer
- module Data.Number.MPFR.Misc
Documentation
Assignment functions
See http://www.mpfr.org/mpfr-current/mpfr.html#Assignment-Functions documentation on particular functions.
module Data.Number.MPFR.Assignment
Conversion functions
See http://www.mpfr.org/mpfr-current/mpfr.html#Conversion-Functions documentation on particular functions.
module Data.Number.MPFR.Conversion
Basic arithmetic functions
For documentation on particular functions see http://www.mpfr.org/mpfr-current/mpfr.html#Basic-Arithmetic-Functions.
module Data.Number.MPFR.Arithmetic
Comparison functions
For documentation on particular functions see http://www.mpfr.org/mpfr-current/mpfr.html#Comparison-Functions
module Data.Number.MPFR.Comparison
Special functions
For documentation on particular functions see http://www.mpfr.org/mpfr-current/mpfr.html#Special-Functions.
module Data.Number.MPFR.Special
Integer related functions
For documentation on particular functions see http://www.mpfr.org/mpfr-chttp://www.mpfr.org/mpfr-current/mpfr.html#Integer-Related-Functions
module Data.Number.MPFR.Integer
Miscellaneous functions
For documentation on particular functions see http://www.mpfr.org/mpfr-current/mpfr.html#Miscellaneous-Functions.
module Data.Number.MPFR.Misc