diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-06 19:28:12 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-06 19:28:12 +0000 |
commit | 54476a60248dbba0ee7b69b8df5b4b160e78913f (patch) | |
tree | 3ed4c603d72825d999e0e5ef8d1f626306ecc7d0 /ext | |
parent | 8db2aa121631435b68160d9d7836a77415dcb0ea (diff) | |
download | ruby-54476a60248dbba0ee7b69b8df5b4b160e78913f.tar.gz |
* ext/bigdecimal/bigdecimal.c (VpCtoV): fix to check overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index ce311a6b12..9a3dec83d8 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4033,9 +4033,9 @@ VpCtoV(Real *a, const char *int_chr, U_LONG ni, const char *frac, U_LONG nf, con while(i < me) { es = e*((S_INT)BASE_FIG); e = e * 10 + exp_chr[i] - '0'; - if(es>e*((S_INT)BASE_FIG)) { + if(es > (S_INT)(e*BASE_FIG)) { exponent_overflow = 1; - e = es; + e = es; /* keep sign */ break; } ++i; |