diff options
author | Richard Stallman <rms@gnu.org> | 1993-06-07 19:43:10 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-06-07 19:43:10 +0000 |
commit | 2b3989120db62c3aa82cf9c8e57262af507c623d (patch) | |
tree | f1d1a645139dce6480dbb995eef2bd180d5c1a51 | |
parent | e1027c772e23988b31f4e3cb6c0346c2cd5f2511 (diff) | |
download | gcc-2b3989120db62c3aa82cf9c8e57262af507c623d.zip gcc-2b3989120db62c3aa82cf9c8e57262af507c623d.tar.gz gcc-2b3989120db62c3aa82cf9c8e57262af507c623d.tar.bz2 |
(atan2): For x <= 0, lump y == 0 with y > 0
to get the right result in 0, -1 case.
From-SVN: r4645
-rw-r--r-- | gcc/ginclude/math-68881.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ginclude/math-68881.h b/gcc/ginclude/math-68881.h index 74525f8..ff06490 100644 --- a/gcc/ginclude/math-68881.h +++ b/gcc/ginclude/math-68881.h @@ -155,19 +155,19 @@ atan2 (double y, double x) } else { - if (y > 0) + if (y < 0) { - if (-x > y) - return pi + atan (y / x); + if (-x > -y) + return - pi + atan (y / x); else - return pi_over_2 - atan (x / y); + return - pi_over_2 - atan (x / y); } else { - if (-x > -y) - return - pi + atan (y / x); - else if (y < 0) - return - pi_over_2 - atan (x / y); + if (-x > y) + return pi + atan (y / x); + else if (y > 0) + return pi_over_2 - atan (x / y); else { double value; |