[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.2 Nomenclature and Types
A floating-point number, or float for short, is an arbitrary
precision significand (also called mantissa) with a limited precision
exponent. The C data type
for such objects is mpfr_t
(internally defined as a one-element
array of a structure, and 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 -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.
The precision is the number of bits used to represent the significand
of a floating-point number;
the corresponding C data type is mpfr_prec_t
.
The precision can be any integer between MPFR_PREC_MIN
and
MPFR_PREC_MAX
. In the current implementation, MPFR_PREC_MIN
is equal to 2.
Warning! MPFR needs to increase the precision internally, in order to
provide accurate results (and in particular, correct rounding). Do not
attempt to set the precision to any value near MPFR_PREC_MAX
,
otherwise MPFR will abort due to an assertion failure. Moreover, you
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).
The 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;
the corresponding C data type is mpfr_rnd_t
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |