From 2b3989120db62c3aa82cf9c8e57262af507c623d Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 7 Jun 1993 19:43:10 +0000 Subject: [PATCH] (atan2): For x <= 0, lump y == 0 with y > 0 to get the right result in 0, -1 case. From-SVN: r4645 --- gcc/ginclude/math-68881.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/ginclude/math-68881.h b/gcc/ginclude/math-68881.h index 74525f8771a..ff06490992e 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; -- 2.30.2