(atan2): For x <= 0, lump y == 0 with y > 0

to get the right result in 0, -1 case.

From-SVN: r4645
This commit is contained in:
Richard Stallman 1993-06-07 19:43:10 +00:00
parent e1027c772e
commit 2b3989120d
1 changed files with 9 additions and 9 deletions

View File

@ -155,19 +155,19 @@ atan2 (double y, double x)
}
else
{
if (y > 0)
{
if (-x > y)
return pi + atan (y / x);
else
return pi_over_2 - atan (x / y);
}
else
if (y < 0)
{
if (-x > -y)
return - pi + atan (y / x);
else if (y < 0)
else
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);
else
{
double value;