mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
94e5fdf336
commit
7e36326c06
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Jun 20 22:49:27 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum.
|
||||||
|
|
||||||
Thu Jun 20 22:29:42 2013 Tanaka Akira <akr@fsij.org>
|
Thu Jun 20 22:29:42 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* bignum.c (rb_uint2big): Refactored.
|
* bignum.c (rb_uint2big): Refactored.
|
||||||
|
|
4
bignum.c
4
bignum.c
|
@ -322,7 +322,9 @@ static VALUE
|
||||||
bignorm(VALUE x)
|
bignorm(VALUE x)
|
||||||
{
|
{
|
||||||
if (RB_TYPE_P(x, T_BIGNUM)) {
|
if (RB_TYPE_P(x, T_BIGNUM)) {
|
||||||
x = bigfixize(bigtrunc(x));
|
x = bigfixize(x);
|
||||||
|
if (!FIXNUM_P(x))
|
||||||
|
bigtrunc(x);
|
||||||
}
|
}
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue