diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-10-29 08:46:26 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-10-29 08:46:26 +0000 |
commit | b74388a838af17ae2ee07dc4e7798b6035b5888f (patch) | |
tree | 4fb37dbe0ff91ad29426f56af1822d632cf636d3 /doc | |
parent | 11b2b18a636cefd0552c3e306891ddc28638575a (diff) | |
download | mpfr-b74388a838af17ae2ee07dc4e7798b6035b5888f.tar.gz |
mpfr_get_str now sets the NaN flag on NaN input. See:
https://sympa.inria.fr/sympa/arc/mpfr/2014-10/msg00013.html and
https://gforge.inria.fr/tracker/index.php?func=detail&aid=18228&group_id=136&atid=619
Also completed the mpfr_get_str description in mpfr.texi concerning
the special numbers and the exception flags.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9221 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc')
-rw-r--r-- | doc/mpfr.texi | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/mpfr.texi b/doc/mpfr.texi index fb39599c9..2326a693b 100644 --- a/doc/mpfr.texi +++ b/doc/mpfr.texi @@ -1484,7 +1484,12 @@ the direction @var{rnd}, where @var{n} is either zero (see below) or the number of significant digits output in the string; in the latter case, @var{n} must be greater or equal to 2. The base may vary from 2 to 62; otherwise the function does nothing and immediately returns a null pointer. -If the input number is an ordinary number, the exponent is written through + +If the input is NaN, then the returned string is @code{@@NaN@@} and the +NaN flag is set. If the input is +Inf (resp.@: @minus{}Inf), then the +returned string is @code{@@Inf@@} (resp.@: @code{-@@Inf@@}). + +If the input number is a finite number, the exponent is written through the pointer @var{expptr} (for input 0, the current minimal exponent is written); the type @code{mpfr_exp_t} is large enough to hold the exponent in all cases. @@ -1532,6 +1537,9 @@ The extra two bytes are for a possible minus sign, and for the terminating null character, and the value 7 accounts for @code{-@@Inf@@} plus the terminating null character. The pointer to the string @var{str} is returned (unless the base is invalid). + +Note: The inexact flag is currently not set when the conversion is inexact; +this is regarded as a bug. @end deftypefun @deftypefun void mpfr_free_str (char *@var{str}) @@ -3610,6 +3618,11 @@ and @code{mpfr_get_uj} changed in MPFR 3.0. In previous MPFR versions, the cases where the @emph{erange} flag is set were unspecified. +@item @code{mpfr_get_str} changed in MPFR 3.2. +This function now sets the NaN flag on NaN input (to follow the usual MPFR +rules on NaN and IEEE 754-2008 recommendations on string conversions from +Subclause 5.12.1). The previous behavior was regarded as a bug. + @item @code{mpfr_get_z} changed in MPFR 3.0. The return type was @code{void}; it is now @code{int}, and the usual ternary value is returned. Thus programs that need to work with both |