From 1d06784bd4aa90b9e84f21d62905ef41c7df4e40 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 16 Mar 1998 01:56:16 +0000 Subject: [PATCH] * sysdeps/m68k/fpu/__math.h (__ieee754_atan2): Reorder conditions to handle x = 0 or y = 0 correctly. --- ChangeLog | 5 +++++ sysdeps/m68k/fpu/__math.h | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a989125f3a9..db16a1d4c4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 16 10:49:57 1998 Andreas Schwab + + * sysdeps/m68k/fpu/__math.h (__ieee754_atan2): Reorder conditions + to handle x = 0 or y = 0 correctly. + 1998-03-14 Ulrich Drepper * string/tester.c (main): Update strsep tests from 2.1. diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h index 82ec88fa76e..2d4f1eb8970 100644 --- a/sysdeps/m68k/fpu/__math.h +++ b/sysdeps/m68k/fpu/__math.h @@ -166,19 +166,19 @@ __m81_defun (float_type, __CONCAT(__ieee754_atan2,s), \ } \ else \ { \ - if (__y > 0) \ + if (__y < 0) \ { \ - if (-__x < __y) \ - return __pi + __m81_u(__CONCAT(__atan,s)) (__y / __x); \ + if (-__x > -__y) \ + return -__pi + __m81_u(__CONCAT(__atan,s)) (__y / __x); \ else \ - return __pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \ + return -__pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \ } \ else \ { \ - if (-__x > -__y) \ - return -__pi + __m81_u(__CONCAT(__atan,s)) (__y / __x); \ + if (-__x > __y) \ + return __pi + __m81_u(__CONCAT(__atan,s)) (__y / __x); \ else \ - return -__pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \ + return __pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \ } \ } \ } \ -- 2.47.2