Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU MPFR
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Library== MPFR's computation is both efficient and has a well-defined semantics: the functions are completely specified on all the possible operands and the results do not depend on the platform.<ref>{{cite web |url=https://www.mpfr.org/faq.html#mpfr_vs_mpf |title=Frequently asked questions about MPFR: 1. What are the differences between MPF from GMP and MPFR? }}</ref> This is done by copying the ideas from the [[IEEE 754|ANSI/IEEE-754]] standard for fixed-precision floating-point arithmetic (correct rounding and exceptions, in particular). More precisely, its main features are: * Support for special numbers: [[signed zero]]s (+0 and −0), [[Infinity#Computing|infinities]] and [[NaN|not-a-number]] (a single NaN is supported: MPFR does not differentiate between quiet NaNs and signaling NaNs). * Each number has its own [[Precision (computer science)|precision]] (in bits since MPFR uses [[radix]] 2). The floating-point results are correctly rounded to the precision of the target variable, in one of the five supported rounding modes (including the four from [[IEEE 754-1985]]). * Supported functions: MPFR implements all mathematical functions from [[C99]] and other usual mathematical functions: the [[logarithm]] and [[exponential function|exponential]] in natural base, base 2 and base 10, the log(1+x) and exp(x)−1 functions (<code>log1p</code> and <code>expm1</code>), the six [[Trigonometric functions|trigonometric]] and [[hyperbolic functions|hyperbolic]] functions and their inverses, the [[Gamma function|gamma]], [[Riemann zeta function|zeta]] and [[error function]]s, the [[arithmetic–geometric mean]], the [[exponentiation|power]] (x<sup>y</sup>) function. All those functions are correctly rounded over their complete range. * [[Subnormal number]]s are not supported, but can be emulated with the <code>mpfr_subnormalize</code> function. MPFR is not able to track the [[accuracy and precision|accuracy]] of numbers in a whole program or expression; this is not its goal. [[Interval arithmetic]] packages like Arb,<ref>{{cite web | url=https://arblib.org/ | title=Arb, a C library for arbitrary-precision ball arithmetic | access-date=May 31, 2022}}</ref> MPFI,<ref>{{cite web | url=https://gitlab.inria.fr/mpfi/mpfi/ | title=MPFI Project | website=GitLab at Inria | access-date=May 31, 2022}}</ref> or [[Real RAM]] implementations like iRRAM,<ref>{{cite web | url=http://irram.uni-trier.de/ | title=iRRAM, a software library for exact real arithmetic | access-date=May 31, 2022}}</ref> which may be based on MPFR, can do that for the user. MPFR is dependent upon the [[GNU Multiple Precision Arithmetic Library]] (GMP). MPFR is needed to build the [[GNU Compiler Collection]] (GCC).<ref>{{cite web | url=https://gcc.gnu.org/gcc-4.3/changes.html#mpfropts | title=GCC 4.3 Release Series: Changes, New Features, and Fixes | date=2012-11-02 | access-date=September 25, 2013}}</ref> Other software uses MPFR, such as [[ALGLIB]], [[CGAL]], [[Fast Library for Number Theory|FLINT]], [[GNOME Calculator]], the [[Julia (programming language)|Julia language]] implementation, the [[Magma (computer algebra system)|Magma computer algebra system]], [[Maple (software)|Maple]], GNU MPC, and [[GNU Octave]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)