diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-16 08:38:14 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-16 08:38:14 +0000 |
commit | d4120b1f1d7d54736dc7f6d0747e2bf6bd2e1ccf (patch) | |
tree | d3949a23dd20286610141dc52dc534b8d31d155e | |
parent | 43025927c6629904b59130bec66fc61ebc83ac4d (diff) | |
download | ruby-d4120b1f1d7d54736dc7f6d0747e2bf6bd2e1ccf.tar.gz |
* ext/bigdecimal/bigdecimal.c (VpCtoV): keep e's sign.
When e doesn't over flow e * BASE_FIG but overflow e * 10,
e will overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 1 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Tue Mar 16 17:33:30 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * ext/bigdecimal/bigdecimal.c (VpCtoV): keep e's sign. + When e doesn't over flow e * BASE_FIG but overflow e * 10, + e will overflow. + Tue Mar 16 17:18:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * include/ruby/encoding.h (rb_str_conv_enc_opts): missing prototype. diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 667f58128d..189a6c77fb 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4045,6 +4045,7 @@ VpCtoV(Real *a, const char *int_chr, U_LONG ni, const char *frac, U_LONG nf, con e = e * 10 + exp_chr[i] - '0'; if(es>e*((S_INT)BASE_FIG)) { exponent_overflow = 1; + e = es; break; } ++i; |