summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-30 10:31:01 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-30 10:31:01 +0000
commit58d20683df37c8f967d160461812e2d5e0914702 (patch)
treeb67777eb64aa0bf5fb1cf47d51b0691cb814d656
parent96d3e3c1a1170d4bef99d5c232cbcc2155175a8f (diff)
downloadruby-58d20683df37c8f967d160461812e2d5e0914702.tar.gz
ruby-58d20683df37c8f967d160461812e2d5e0914702.tar.xz
ruby-58d20683df37c8f967d160461812e2d5e0914702.zip
* bignum.c (rb_big2str0): use better approximation.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 329aeef87..29b800fd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* bignum.c (rb_big2str0): wrong allocation length. a patch from
diff --git a/bignum.c b/bignum.c
index 0bfeffaa5..f0c3a0f63 100644
--- a/bignum.c
+++ b/bignum.c
@@ -598,7 +598,7 @@ rb_big2str0(VALUE x, int base, int trim)
switch (base) {
case 2: break;
case 3:
- j = j * 647L / 1024;
+ j = j * 53L / 84 + 1;
break;
case 4: case 5: case 6: case 7:
j /= 2;
@@ -607,7 +607,7 @@ rb_big2str0(VALUE x, int base, int trim)
j /= 3;
break;
case 10: case 11: case 12: case 13: case 14: case 15:
- j = j * 241L / 800 + 1;
+ j = j * 28L / 93 + 1;
break;
case 16: case 17: case 18: case 19: case 20: case 21:
case 22: case 23: case 24: case 25: case 26: case 27: