summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-12 15:04:17 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-12 15:04:17 +0000
commit9820fd726e54c0cb8d7182398914bf1ab01a7fb5 (patch)
treeb63c5a29c63556811534a7f7fee8336651e8eb61
parent009dc2a838df31d815b277d5e7ec7206ee9ce9d8 (diff)
downloadmpfr-9820fd726e54c0cb8d7182398914bf1ab01a7fb5.tar.gz
[doc/mpfr.texi] In Section "Nomenclature and Types":
* rewrote the paragraph defining "floating-point number", avoiding ambiguities; * removed all the @noindent, whose purpose is unclear; * defined regular numbers and exponents. (merged changesets r12906-12908 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/4.0@12917 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--doc/mpfr.texi52
1 files changed, 30 insertions, 22 deletions
diff --git a/doc/mpfr.texi b/doc/mpfr.texi
index ed139fd82..c8e7e9217 100644
--- a/doc/mpfr.texi
+++ b/doc/mpfr.texi
@@ -654,30 +654,31 @@ symbols using these prefixes.
@section Nomenclature and Types
@cindex Floating-point number
+@cindex Regular number
@tindex @code{mpfr_t}
-@noindent
-A @dfn{floating-point number}, or @dfn{float} for short, is an arbitrary
-precision significand (also called mantissa) with a limited precision
-exponent. The C data type
-for such objects is @code{mpfr_t} (internally defined as a one-element
-array of a structure, and @code{mpfr_ptr} is the C data type representing
-a pointer to this structure). A floating-point number can have
-three special values: Not-a-Number (NaN) or plus or minus Infinity. NaN
-represents an uninitialized object, the result of an invalid operation
-(like 0 divided by 0), or a value that cannot be determined (like
-+Infinity minus +Infinity). Moreover, like in the IEEE 754 standard,
-zero is signed, i.e., there are both +0 and @minus{}0; the behavior
-is the same as in the IEEE 754 standard and it is generalized to
-the other functions supported by MPFR@. Unless documented otherwise,
-the sign bit of a NaN is unspecified.
-@c VL: re-added how mpfr_t is defined, due to some questions from users
-@c in the past (the fact that the result was returned in an argument
-@c seemed strange); also, mpfr_ptr needs to be defined here, as it is
-@c used in the API.
+@tindex @code{mpfr_ptr}
+A @dfn{floating-point number}, or @dfn{float} for short, is an object
+representing a radix-2 floating-point number consisting of a sign,
+an arbitrary-precision normalized significand (also called mantissa),
+and an exponent (an integer in some given range); these are called
+@dfn{regular numbers}. Like in the IEEE 754 standard, a floating-point
+number can also have three kinds of special values: a signed zero, a
+signed infinity, and Not-a-Number (NaN)@. NaN can represent the default
+value of a floating-point object and the result of some operations for
+which no other results would make sense, such as 0 divided by 0 or
++Infinity minus +Infinity; unless documented otherwise, the sign bit of
+a NaN is unspecified. Note that contrary to IEEE 754, MPFR has a single
+kind of NaN and does not have subnormals. Other than that, the behavior
+is very similar to IEEE 754, but there may be some differences.
+
+The C data type for such objects is @code{mpfr_t}, internally defined
+as a one-element array of a structure (so that when passed as an
+argument to a function, it is the pointer that is actually passed),
+and @code{mpfr_ptr} is the C data type representing a pointer to this
+structure.
@cindex Precision
@tindex @code{mpfr_prec_t}
-@noindent
The @dfn{precision} is the number of bits used to represent the significand
of a floating-point number;
the corresponding C data type is @code{mpfr_prec_t}.
@@ -693,12 +694,19 @@ may reach some memory limit on your platform, in which case the program
may abort, crash or have undefined behavior (depending on your C
implementation).
+@cindex Exponent
+@tindex @code{mpfr_exp_t}
+An @dfn{exponent} is a component of a regular floating-point number.
+Its C data type is @code{mpfr_exp_t}. Valid exponents are restricted
+to a subset of this type, and the exponent range can be changed globally
+as described in @ref{Exception Related Functions}. Special values do not
+have an exponent.
+
@cindex Rounding Modes
@tindex @code{mpfr_rnd_t}
-@noindent
The @dfn{rounding mode} specifies the way to round the result of a
floating-point operation, in case the exact result can not be represented
-exactly in the destination significand;
+exactly in the destination;
the corresponding C data type is @code{mpfr_rnd_t}.
@cindex Group of flags