summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS8
-rw-r--r--TODO1
-rw-r--r--doc/mpfr.texi13
3 files changed, 15 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 07ef8d86d..766f95c1f 100644
--- a/NEWS
+++ b/NEWS
@@ -22,10 +22,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
Changes from versions 4.1.* to version 4.2.0:
- The "" release.
-- New functions mpfr_cosu, mpfr_sinu, mpfr_tanu, mpfr_acosu, mpfr_asinu and
- mpfr_atanu.
-- New functions mpfr_cospi, mpfr_sinpi, mpfr_tanpi, mpfr_acospi, mpfr_asinpi
- and mpfr_atanpi.
+- New functions mpfr_cosu, mpfr_sinu, mpfr_tanu, mpfr_acosu, mpfr_asinu,
+ mpfr_atanu and mpfr_atan2u.
+- New functions mpfr_cospi, mpfr_sinpi, mpfr_tanpi, mpfr_acospi, mpfr_asinpi,
+ mpfr_atanpi and mpfr_atan2pi.
- New function mpfr_log2p1 and mpfr_compound.
- New function mpfr_fmod_ui.
- Bug fixes.
diff --git a/TODO b/TODO
index ff5bb6fc0..0f99b3c13 100644
--- a/TODO
+++ b/TODO
@@ -114,7 +114,6 @@ Table of contents:
- cr_xxx functions from http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2596.pdf
(page 392):
- atan2pi
exp10m1, exp2m1, log10p1
pown (but there is mpfr_pow_si with n long instead of intmax_t)
powr = exp(y*log(x)). The difference with pow = x^y is that when x < 0
diff --git a/doc/mpfr.texi b/doc/mpfr.texi
index db17e1954..227ab85a4 100644
--- a/doc/mpfr.texi
+++ b/doc/mpfr.texi
@@ -2353,14 +2353,21 @@ divided by @m{\pi,Pi}.
@end deftypefun
@deftypefun int mpfr_atan2 (mpfr_t @var{rop}, mpfr_t @var{y}, mpfr_t @var{x}, mpfr_rnd_t @var{rnd})
-Set @var{rop} to the arc-tangent2 of @var{y} and @var{x},
-rounded in the direction @var{rnd}:
+@deftypefunx int mpfr_atan2u (mpfr_t @var{rop}, mpfr_t @var{y}, mpfr_t @var{x}, unsigned long int @var{u}, mpfr_rnd_t @var{rnd})
+@deftypefunx int mpfr_atan2pi (mpfr_t @var{rop}, mpfr_t @var{y}, mpfr_t @var{x}, mpfr_rnd_t @var{rnd})
+For @code{mpfr_atan2}, set @var{rop} to the arc-tangent2 of @var{y} and
+@var{x}, rounded in the direction @var{rnd}:
if @code{x > 0}, @code{atan2(y, x) = atan(y/x)};
if @code{x < 0}, @code{atan2(y, x) = sign(y)*(Pi - atan(@GMPabs{y/x}))},
thus a number from @m{-\pi,-Pi} to @m{\pi,Pi}.
As for @code{atan}, in case the exact mathematical result is @m{+\pi,+Pi} or
@m{-\pi,-Pi},
its rounded result might be outside the function output range.
+The function @code{mpfr_atan2u} behaves similarly, except the result is
+multiplied by @var{u} and divided by 2@tie{}Pi; and @code{mpfr_atan2pi}
+is the same as @code{mpfr_atan2u} with @code{u=2}.
+For example, if @var{u} equals 360, @code{mpfr_atan2u} returns the
+arc-tangent in degrees, with values from @minus{}180 to 180.
@code{atan2(y, 0)} does not raise any floating-point exception.
Special values are handled as described in the ISO C99 and IEEE@tie{}754-2008
@@ -4135,6 +4142,8 @@ that were added after MPFR@tie{}2.2, and in which MPFR version.
@item @code{mpfr_atanpi} and @code{mpfr_atanu} in MPFR@tie{}4.2.
+@item @code{mpfr_atan2pi} and @code{mpfr_atan2u} in MPFR@tie{}4.2.
+
@item @code{mpfr_beta} in MPFR@tie{}4.0 (incomplete, experimental).
@item @code{mpfr_buildopt_decimal_p} in MPFR@tie{}3.0.