diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-26 15:21:25 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-26 15:21:25 +0000 |
commit | 48b4d8c528696a03b8a924c084f24bdc263262dc (patch) | |
tree | c227effffa64b01b35e5eb33bad7b3112f7c9671 | |
parent | 6ce499423142f45c3524a611e3b7da09eea8154e (diff) | |
download | ruby-48b4d8c528696a03b8a924c084f24bdc263262dc.tar.gz |
* ext/bigdecimal/bigdecimal.c (VpCtoV): do not raise infinity
exception for BigDecimal("0E200000000000").
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Wed Jan 27 00:19:30 2010 Yusuke Endoh <mame@tsg.ne.jp> + + * ext/bigdecimal/bigdecimal.c (VpCtoV): do not raise infinity + exception for BigDecimal("0E200000000000"). + Tue Jan 26 21:50:31 2010 Yusuke Endoh <mame@tsg.ne.jp> * ext/bigdecimal/bigdecimal.c (VpCtoV): BigDecimal("0E200000000000") diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 5a532e14e0..1172b136a4 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4079,9 +4079,11 @@ VpCtoV(Real *a, const char *int_chr, U_LONG ni, const char *frac, U_LONG nf, con int zero = 1; for( ; i < mi && zero; i++) zero = int_chr[i] == '0'; for(i = 0; i < nf && zero; i++) zero = frac[i] == '0'; - if(!zero && signe > 0) VpSetInf(a, sign); + if(!zero && signe > 0) { + VpSetInf(a, sign); + VpException(VP_EXCEPTION_INFINITY,"exponent overflow",0); + } else VpSetZero(a, sign); - VpException(VP_EXCEPTION_INFINITY,"exponent overflow",0); return 1; } |