summaryrefslogtreecommitdiff
path: root/ext/bigdecimal
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-06 19:28:12 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-06 19:28:12 +0000
commit54476a60248dbba0ee7b69b8df5b4b160e78913f (patch)
tree3ed4c603d72825d999e0e5ef8d1f626306ecc7d0 /ext/bigdecimal
parent8db2aa121631435b68160d9d7836a77415dcb0ea (diff)
* 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/bigdecimal')
-rw-r--r--ext/bigdecimal/bigdecimal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index ce311a6b122..9a3dec83d83 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;