mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (big2str_karatsuba): Fix a condition of power_level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b4dd68ff96
commit
eed6c15a21
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Aug 1 01:45:18 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (big2str_karatsuba): Fix a condition of power_level.
|
||||
|
||||
Thu Aug 1 01:09:02 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (LOG2_KARATSUBA_BIG2STR_DIGITS): Removed.
|
||||
|
|
4
bignum.c
4
bignum.c
|
@ -4225,6 +4225,8 @@ big2str_orig(struct big2str_struct *b2s, VALUE x, char* ptr, size_t len, int tri
|
|||
size_t j = len;
|
||||
BDIGIT* ds = BDIGITS(x);
|
||||
|
||||
assert(i <= 2);
|
||||
|
||||
while (i && j > 0) {
|
||||
long k = i;
|
||||
BDIGIT_DBL num = 0;
|
||||
|
@ -4266,7 +4268,7 @@ big2str_karatsuba(struct big2str_struct *b2s, VALUE x, char* ptr,
|
|||
}
|
||||
}
|
||||
|
||||
if (power_level == 0) {
|
||||
if (power_level < 0) {
|
||||
return big2str_orig(b2s, x, ptr, len, trim);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue