* bignum.c (big_lshift, big_rshift): return Bignum always without
normalization. [ruby-dev:38679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f0a75dbba8
commit
44a1d99635
@ -1,3 +1,8 @@
|
|||||||
|
Fri Jun 19 08:14:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* bignum.c (big_lshift, big_rshift): return Bignum always withou
|
||||||
|
normalization. [ruby-dev:38679]
|
||||||
|
|
||||||
Thu Jun 18 22:31:38 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
Thu Jun 18 22:31:38 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* rational.c (nurat_s_convert): calls to_r when the given argument
|
* rational.c (nurat_s_convert): calls to_r when the given argument
|
||||||
@ -124,7 +129,7 @@ Wed Jun 17 07:04:33 2009 Koichi Sasada <ko1@atdot.net>
|
|||||||
Wed Jun 17 06:48:28 2009 Koichi Sasada <ko1@atdot.net>
|
Wed Jun 17 06:48:28 2009 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* st.c, include/ruby/st.h (st_memsize): added. This function returns
|
* st.c, include/ruby/st.h (st_memsize): added. This function returns
|
||||||
the memory usage of st_talbe.
|
the memory usage of st_table.
|
||||||
|
|
||||||
Wed Jun 17 06:19:06 2009 Koichi Sasada <ko1@atdot.net>
|
Wed Jun 17 06:19:06 2009 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
12
bignum.c
12
bignum.c
@ -2896,8 +2896,8 @@ rb_big_lshift(VALUE x, VALUE y)
|
|||||||
y = rb_to_int(y);
|
y = rb_to_int(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (neg) return big_rshift(x, shift);
|
x = neg ? big_rshift(x, shift) : big_lshift(x, shift);
|
||||||
return big_lshift(x, shift);
|
return bignorm(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -2923,7 +2923,7 @@ big_lshift(VALUE x, unsigned long shift)
|
|||||||
num = BIGDN(num);
|
num = BIGDN(num);
|
||||||
}
|
}
|
||||||
*zds = BIGLO(num);
|
*zds = BIGLO(num);
|
||||||
return bignorm(z);
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2962,8 +2962,8 @@ rb_big_rshift(VALUE x, VALUE y)
|
|||||||
y = rb_to_int(y);
|
y = rb_to_int(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (neg) return big_lshift(x, shift);
|
x = neg ? big_lshift(x, shift) : big_rshift(x, shift);
|
||||||
return big_rshift(x, shift);
|
return bignorm(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -3006,7 +3006,7 @@ big_rshift(VALUE x, unsigned long shift)
|
|||||||
if (!RBIGNUM_SIGN(x)) {
|
if (!RBIGNUM_SIGN(x)) {
|
||||||
get2comp(z);
|
get2comp(z);
|
||||||
}
|
}
|
||||||
return bignorm(z);
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user