* bignum.c (rb_big2str0): should preserve sign mark.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9644a2c02c
commit
b42698eaff
@ -1,3 +1,7 @@
|
|||||||
|
Wed Aug 8 11:25:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* bignum.c (rb_big2str0): should preserve sign mark.
|
||||||
|
|
||||||
Wed Aug 8 11:02:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Aug 8 11:02:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* common.mk (btest-miniruby, test-sample): split the test target
|
* common.mk (btest-miniruby, test-sample): split the test target
|
||||||
|
6
bignum.c
6
bignum.c
@ -867,14 +867,14 @@ rb_big2str0(VALUE x, int base, int trim)
|
|||||||
#if SIZEOF_BDIGITS > 2
|
#if SIZEOF_BDIGITS > 2
|
||||||
hbase *= hbase;
|
hbase *= hbase;
|
||||||
#endif
|
#endif
|
||||||
off = !RTEST(trim) && !RBIGNUM(x)->sign;
|
off = !RTEST(trim) || !RBIGNUM(x)->sign;
|
||||||
xx = rb_big_clone(x);
|
xx = rb_big_clone(x);
|
||||||
RBIGNUM(xx)->sign = 1;
|
RBIGNUM(xx)->sign = 1;
|
||||||
if (n1 <= KARATSUBA_DIGITS) {
|
if (n1 <= KARATSUBA_DIGITS) {
|
||||||
len = big2str_orig(xx, base, ptr + off, 2*n1, hbase, RTEST(trim));
|
len = off + big2str_orig(xx, base, ptr + off, 2*n1, hbase, RTEST(trim));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
len = big2str_karatsuba(xx, base, ptr + off, n1,
|
len = off + big2str_karatsuba(xx, base, ptr + off, n1,
|
||||||
2*n1, hbase, RTEST(trim));
|
2*n1, hbase, RTEST(trim));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user