about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-03-19 20:11:09 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-03-19 20:11:09 +0000
commit7726d6a95d5a2c08c8d43186002f040b9b889c27 (patch)
treea26c3837e5c05db789f8dfb66cd144791469baeb /sysdeps/ieee754/dbl-64
parent83d1aec8fc5f4250e6d5f44eeef30c923e140ca4 (diff)
downloadglibc-7726d6a95d5a2c08c8d43186002f040b9b889c27.tar.gz
glibc-7726d6a95d5a2c08c8d43186002f040b9b889c27.tar.xz
glibc-7726d6a95d5a2c08c8d43186002f040b9b889c27.zip
Fix atan2 spurious exceptions (bug 11451).
Diffstat (limited to 'sysdeps/ieee754/dbl-64')
-rw-r--r--sysdeps/ieee754/dbl-64/e_atan2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_atan2.c b/sysdeps/ieee754/dbl-64/e_atan2.c
index dcef55f072..497afcab1e 100644
--- a/sysdeps/ieee754/dbl-64/e_atan2.c
+++ b/sysdeps/ieee754/dbl-64/e_atan2.c
@@ -1,7 +1,7 @@
 /*
  * IBM Accurate Mathematical Library
  * written by International Business Machines Corp.
- * Copyright (C) 2001, 2011 Free Software Foundation
+ * Copyright (C) 2001-2012 Free Software Foundation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -153,6 +153,13 @@ __ieee754_atan2(double y,double x) {
   /* if either x or y is extremely close to zero, scale abs(x), abs(y). */
   if (ax<twom500.d || ay<twom500.d) { ax*=two500.d;  ay*=two500.d; }
 
+  /* Likewise for large x and y.  */
+  if (ax > two500.d || ay > two500.d)
+    {
+      ax *= twom500.d;
+      ay *= twom500.d;
+    }
+
   /* x,y which are neither special nor extreme */
   if (ay<ax) {
     u=ay/ax;