diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2004-02-01 03:10:17 +0300 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2004-02-01 03:10:17 +0300 |
commit | 416bc450609d4845ee47a79342f4af99b0bf7036 (patch) | |
tree | 0f29082d190a9f6335ff9a3bad9918dd4d1a0509 /winsup/mingw/mingwex | |
parent | fff0b496a0f84550557457f2614805daf3e8928d (diff) |
* mingwex/math/powl.c (powl): Return infinity if
extended precision multiplication of x by log2(y)
overflows.
Diffstat (limited to 'winsup/mingw/mingwex')
-rw-r--r-- | winsup/mingw/mingwex/math/powl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/math/powl.c b/winsup/mingw/mingwex/math/powl.c index 2a09ae1e0..19910bd66 100644 --- a/winsup/mingw/mingwex/math/powl.c +++ b/winsup/mingw/mingwex/math/powl.c @@ -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; |