summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/mpfr.texi13
1 files changed, 11 insertions, 2 deletions
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.