[cmucl-commit] [git] CMU Common Lisp branch master updated. snapshot-2014-09-24-gf61fb85
Raymond Toy
rtoy at common-lisp.net
Wed Oct 1 04:11:45 UTC 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, master has been updated
via f61fb8591ba745046f96770093330be7d12e45d2 (commit)
from 33adf3d4d02f8416b829569af99735a5b28c9d73 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f61fb8591ba745046f96770093330be7d12e45d2
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Tue Sep 30 21:11:36 2014 -0700
Fix a couple of issues in the code.
* Use fdlibm_setexception to handle the case when the arg is NaN or
Inf. (Previously depended on x+x doing the right thing.)
* Fix a compiler warning about possible dangling else by adding
braces as needed.
diff --git a/src/lisp/s_scalbn.c b/src/lisp/s_scalbn.c
index 4889385..1993bbb 100644
--- a/src/lisp/s_scalbn.c
+++ b/src/lisp/s_scalbn.c
@@ -52,15 +52,24 @@ tiny = 1.0e-300;
k = ((hx&0x7ff00000)>>20) - 54;
if (n< -50000) return fdlibm_setexception(x, FDLIBM_UNDERFLOW);; /*underflow*/
}
- if (k==0x7ff) return x+x; /* NaN or Inf */
+ if (k==0x7ff) {
+ /* NaN or Inf */
+ if(((hx&0xfffff)|lx)!=0) {
+ return fdlibm_setexception(x, FDLIBM_INVALID);
+ } else {
+ return fdlibm_setexception(x, FDLIBM_OVERFLOW);
+ }
+ }
+
k = k+n;
if (k > 0x7fe) return fdlibm_setexception(x, FDLIBM_OVERFLOW); /* overflow */
if (k > 0) /* normal result */
{ux.i[HIWORD] = (hx&0x800fffff)|(k<<20); return x;}
- if (k <= -54)
+ if (k <= -54) {
if (n > 50000) /* in case integer overflow in n+k */
return fdlibm_setexception(x, FDLIBM_OVERFLOW); /*overflow*/
else return fdlibm_setexception(x, FDLIBM_UNDERFLOW); /*underflow*/
+ }
k += 54; /* subnormal result */
ux.i[HIWORD] = (hx&0x800fffff)|(k<<20);
return x*twom54;
-----------------------------------------------------------------------
Summary of changes:
src/lisp/s_scalbn.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-commit
mailing list