зеркало из https://github.com/github/ruby.git
* bignum.c (rb_big2str0): use better approximation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e9f4ae6f0e
Коммит
3679754a95
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Oct 30 19:28:02 2006 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* bignum.c (rb_big2str0): use better approximation.
|
||||||
|
|
||||||
Mon Oct 30 18:35:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Oct 30 18:35:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* bignum.c (rb_big2str0): wrong allocation length. a patch from
|
* bignum.c (rb_big2str0): wrong allocation length. a patch from
|
||||||
|
|
4
bignum.c
4
bignum.c
|
@ -598,7 +598,7 @@ rb_big2str0(VALUE x, int base, int trim)
|
||||||
switch (base) {
|
switch (base) {
|
||||||
case 2: break;
|
case 2: break;
|
||||||
case 3:
|
case 3:
|
||||||
j = j * 647L / 1024;
|
j = j * 53L / 84 + 1;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6: case 7:
|
case 4: case 5: case 6: case 7:
|
||||||
j /= 2;
|
j /= 2;
|
||||||
|
@ -607,7 +607,7 @@ rb_big2str0(VALUE x, int base, int trim)
|
||||||
j /= 3;
|
j /= 3;
|
||||||
break;
|
break;
|
||||||
case 10: case 11: case 12: case 13: case 14: case 15:
|
case 10: case 11: case 12: case 13: case 14: case 15:
|
||||||
j = j * 241L / 800 + 1;
|
j = j * 28L / 93 + 1;
|
||||||
break;
|
break;
|
||||||
case 16: case 17: case 18: case 19: case 20: case 21:
|
case 16: case 17: case 18: case 19: case 20: case 21:
|
||||||
case 22: case 23: case 24: case 25: case 26: case 27:
|
case 22: case 23: case 24: case 25: case 26: case 27:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче