]> sourceware.org Git - newlib-cygwin.git/commitdiff
* mingwex/math/powl.c (powl): Return infinity if
authorDanny Smith <dannysmith@users.sourceforge.net>
Sun, 1 Feb 2004 00:10:17 +0000 (00:10 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Sun, 1 Feb 2004 00:10:17 +0000 (00:10 +0000)
extended precision multiplication of x by log2(y)
overflows.

winsup/mingw/ChangeLog
winsup/mingw/mingwex/math/powl.c

index ba08d33d709a8302915bd6dac3c1ff9e7b992d06..f32087fac12e298a5243462e72a91896a550302f 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-01  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * mingwex/math/powl.c (powl): Return infinity if
+       extended precision multiplication of x by log2(y)
+       overflows.
+
 2004-01-31  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * mingwex/math/cephes_emath.h (__enan_64): Fix thinko.
index 2a09ae1e02b2fe744aa3492a9e2281f071498e71..19910bd6676b7b64680c1b93422f96ade11381d6 100644 (file)
@@ -690,6 +690,14 @@ Fa = reducl(F);
 Fb = F - Fa;
 
 G = Fa + w * ya;
+if (isinf (G))
+  {
+   /* Bail out: G - reducl(G) will result in NAN
+      that will propagate through rest of calculations */ 
+    _SET_ERRNO (ERANGE);
+    mtherr( fname, OVERFLOW );
+    return( MAXNUML );
+  }
 Ga = reducl(G);
 Gb = G - Ga;
 
This page took 0.034511 seconds and 5 git commands to generate.