aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-07 19:43:10 +0000
committerRichard Stallman <rms@gnu.org>1993-06-07 19:43:10 +0000
commit2b3989120db62c3aa82cf9c8e57262af507c623d (patch)
treef1d1a645139dce6480dbb995eef2bd180d5c1a51
parente1027c772e23988b31f4e3cb6c0346c2cd5f2511 (diff)
downloadgcc-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.h16
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;