diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-30 10:31:01 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-30 10:31:01 +0000 |
commit | 3679754a95df33dd576cf9f81ae2ef70a84a6649 (patch) | |
tree | b67777eb64aa0bf5fb1cf47d51b0691cb814d656 /bignum.c | |
parent | e9f4ae6f0e24b2386127e5b848dbc7365be6d989 (diff) | |
download | ruby-3679754a95df33dd576cf9f81ae2ef70a84a6649.tar.gz |
* bignum.c (rb_big2str0): use better approximation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |