OSDN Git Service

(atan2): For x <= 0, lump y == 0 with y > 0
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jun 1993 19:43:10 +0000 (19:43 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jun 1993 19:43:10 +0000 (19:43 +0000)
to get the right result in 0, -1 case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4645 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ginclude/math-68881.h

index 74525f8..ff06490 100644 (file)
@@ -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;