diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-18 03:17:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-18 03:17:06 +0000 |
commit | 3851ac03b597c9ab90783cdc60937c95d8792f0e (patch) | |
tree | fb2448194681b81c820575782a080025dfda8132 /numeric.c | |
parent | 4048548f7fc21d3c83881227cbcf08a91256cd14 (diff) | |
download | ruby-3851ac03b597c9ab90783cdc60937c95d8792f0e.tar.gz |
* numeric.c (fix_mul): get rid of shift overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1989,7 +1989,7 @@ fix_mul(VALUE x, VALUE y) if (FIXABLE(d)) return LONG2FIX(d); return rb_ll2inum(d); #else -# define SQRT_LONG_MAX (1<<((SIZEOF_VALUE*CHAR_BIT-1)/2)) +# define SQRT_LONG_MAX ((SIZEOF_VALUE)1<<((SIZEOF_VALUE*CHAR_BIT-1)/2)) /*tests if N*N would overflow*/ # define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((n)>=-SQRT_LONG_MAX)) if (FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b)) |