diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-18 16:02:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-18 16:02:21 +0000 |
commit | fe737a1e1d0f49073ba49e2df2ea90db1795af80 (patch) | |
tree | 161aaf4fc1595eaedf1983142a20b1c8d09bff43 /ext | |
parent | 32004e3c46bb323a6559ad0a357dc3de1008abce (diff) | |
download | ruby-fe737a1e1d0f49073ba49e2df2ea90db1795af80.tar.gz |
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): went infinity too
early. add BASE_FIG margin. [ruby-dev:38673]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index d80e0a764e..0b2ac34b15 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -605,7 +605,7 @@ BigDecimal_to_f(VALUE self) GUARD_OBJ(p,GetVpValue(self,1)); if (VpVtoD(&d, &e, p)!=1) return rb_float_new(d); - if (e > DBL_MAX_10_EXP) goto erange; + if (e > DBL_MAX_10_EXP+BASE_FIG) goto erange; str = rb_str_new(0, VpNumOfChars(p,"E")); buf = RSTRING_PTR(str); VpToString(p, buf, 0, 0); |