зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
32004e3c46
Коммит
fe737a1e1d
|
@ -18,6 +18,11 @@ Thu Jun 18 16:21:05 2009 Ryan Davis <ryand-ruby@zenspider.com>
|
|||
* lib/minitest/*.rb: Imported minitest 1.4.0 r5083.
|
||||
* test/minitest/*.rb: ditto.
|
||||
|
||||
Thu Jun 18 10:12:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): went infinity too
|
||||
early. add BASE_FIG margin. [ruby-dev:38673]
|
||||
|
||||
Thu Jun 18 01:35:51 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* numeric.c (flo_cmp): Infinity is greater than any bignum
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче