diff options
-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; |