You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
4.5 KiB
HTML
110 lines
4.5 KiB
HTML
4 years ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
|
<html>
|
||
|
<!-- This manual documents how to install and use the Multiple Precision
|
||
|
Floating-Point Reliable Library, version 3.1.4.
|
||
|
|
||
|
Copyright 1991, 1993-2016 Free Software Foundation, Inc.
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document under
|
||
|
the terms of the GNU Free Documentation License, Version 1.2 or any later
|
||
|
version published by the Free Software Foundation; with no Invariant Sections,
|
||
|
with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the
|
||
|
license is included in GNU Free Documentation License. -->
|
||
|
<!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ -->
|
||
|
<head>
|
||
|
<title>Internals (GNU MPFR 3.1.4)</title>
|
||
|
|
||
|
<meta name="description" content="How to install and use GNU MPFR, a library for reliable multiple precision
|
||
|
floating-point arithmetic, version 3.1.4.">
|
||
|
<meta name="keywords" content="Internals (GNU MPFR 3.1.4)">
|
||
|
<meta name="resource-type" content="document">
|
||
|
<meta name="distribution" content="global">
|
||
|
<meta name="Generator" content="makeinfo">
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<link href="index.html#Top" rel="start" title="Top">
|
||
|
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
|
||
|
<link href="MPFR-Interface.html#MPFR-Interface" rel="up" title="MPFR Interface">
|
||
|
<link href="API-Compatibility.html#API-Compatibility" rel="next" title="API Compatibility">
|
||
|
<link href="Custom-Interface.html#Custom-Interface" rel="prev" title="Custom Interface">
|
||
|
<style type="text/css">
|
||
|
<!--
|
||
|
a.summary-letter {text-decoration: none}
|
||
|
blockquote.indentedblock {margin-right: 0em}
|
||
|
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
|
||
|
blockquote.smallquotation {font-size: smaller}
|
||
|
div.display {margin-left: 3.2em}
|
||
|
div.example {margin-left: 3.2em}
|
||
|
div.lisp {margin-left: 3.2em}
|
||
|
div.smalldisplay {margin-left: 3.2em}
|
||
|
div.smallexample {margin-left: 3.2em}
|
||
|
div.smalllisp {margin-left: 3.2em}
|
||
|
kbd {font-style: oblique}
|
||
|
pre.display {font-family: inherit}
|
||
|
pre.format {font-family: inherit}
|
||
|
pre.menu-comment {font-family: serif}
|
||
|
pre.menu-preformatted {font-family: serif}
|
||
|
pre.smalldisplay {font-family: inherit; font-size: smaller}
|
||
|
pre.smallexample {font-size: smaller}
|
||
|
pre.smallformat {font-family: inherit; font-size: smaller}
|
||
|
pre.smalllisp {font-size: smaller}
|
||
|
span.nolinebreak {white-space: nowrap}
|
||
|
span.roman {font-family: initial; font-weight: normal}
|
||
|
span.sansserif {font-family: sans-serif; font-weight: normal}
|
||
|
ul.no-bullet {list-style: none}
|
||
|
-->
|
||
|
</style>
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body lang="en">
|
||
|
<a name="Internals"></a>
|
||
|
<div class="header">
|
||
|
<p>
|
||
|
Previous: <a href="Custom-Interface.html#Custom-Interface" accesskey="p" rel="prev">Custom Interface</a>, Up: <a href="MPFR-Interface.html#MPFR-Interface" accesskey="u" rel="up">MPFR Interface</a> [<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<a name="index-Internals"></a>
|
||
|
<a name="Internals-1"></a>
|
||
|
<h3 class="section">5.16 Internals</h3>
|
||
|
|
||
|
<a name="index-Limb"></a>
|
||
|
<p>A <em>limb</em> means the part of a multi-precision number that fits in a single
|
||
|
word. Usually a limb contains
|
||
|
32 or 64 bits. The C data type for a limb is <code>mp_limb_t</code>.
|
||
|
</p>
|
||
|
<p>The <code>mpfr_t</code> type is internally defined as a one-element
|
||
|
array of a structure, and <code>mpfr_ptr</code> is the C data type representing
|
||
|
a pointer to this structure.
|
||
|
The <code>mpfr_t</code> type consists of four fields:
|
||
|
</p>
|
||
|
<ul>
|
||
|
<li> The <code>_mpfr_prec</code> field is used to store the precision of
|
||
|
the variable (in bits); this is not less than <code>MPFR_PREC_MIN</code>.
|
||
|
|
||
|
</li><li> The <code>_mpfr_sign</code> field is used to store the sign of the variable.
|
||
|
|
||
|
</li><li> The <code>_mpfr_exp</code> field stores the exponent.
|
||
|
An exponent of 0 means a radix point just above the most significant
|
||
|
limb. Non-zero values <em>n</em> are a multiplier <em>2^n</em> relative to that
|
||
|
point.
|
||
|
A NaN, an infinity and a zero are indicated by special values of the exponent
|
||
|
field.
|
||
|
|
||
|
</li><li> Finally, the <code>_mpfr_d</code> field is a pointer to the limbs, least
|
||
|
significant limbs stored first.
|
||
|
The number of limbs in use is controlled by <code>_mpfr_prec</code>, namely
|
||
|
ceil(<code>_mpfr_prec</code>/<code>mp_bits_per_limb</code>).
|
||
|
Non-singular (i.e., different from NaN, Infinity or zero)
|
||
|
values always have the most significant bit of the most
|
||
|
significant limb set to 1. When the precision does not correspond to a
|
||
|
whole number of limbs, the excess bits at the low end of the data are zeros.
|
||
|
|
||
|
</li></ul>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|