mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
to convert a double value to a Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e337c7f979
commit
1db209763a
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Jun 01 01:50:00 2013 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
|
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
|
||||||
|
to convert a double value to a Bignum.
|
||||||
|
|
||||||
Sat Jun 1 00:19:50 2013 Tanaka Akira <akr@fsij.org>
|
Sat Jun 1 00:19:50 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* bignum.c (calc_hbase): Make hbase the maximum power of base
|
* bignum.c (calc_hbase): Make hbase the maximum power of base
|
||||||
|
|
|
@ -2183,7 +2183,12 @@ retry:
|
||||||
case T_FLOAT:
|
case T_FLOAT:
|
||||||
d = RFLOAT_VALUE(vexp);
|
d = RFLOAT_VALUE(vexp);
|
||||||
if (d == round(d)) {
|
if (d == round(d)) {
|
||||||
vexp = LL2NUM((LONG_LONG)round(d));
|
if (FIXABLE(d)) {
|
||||||
|
vexp = LONG2FIX((long)d);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
vexp = rb_dbl2big(d);
|
||||||
|
}
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
exp = GetVpValueWithPrec(vexp, DBL_DIG+1, 1);
|
exp = GetVpValueWithPrec(vexp, DBL_DIG+1, 1);
|
||||||
|
|
Loading…
Reference in a new issue