1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bignum.c (rb_big2str0): do not clobber space for sign.

* sprintf.c (remove_sign_bits): extends sign bit first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-11-28 00:51:44 +00:00
parent 641be733a6
commit b76bf9f66f
4 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Wed Nov 28 09:51:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big2str0): do not clobber space for sign.
* sprintf.c (remove_sign_bits): extends sign bit first.
Wed Nov 21 01:04:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (nil_plus): remove unused function. [ruby-core:13737]

View file

@ -709,7 +709,7 @@ rb_big2str0(x, base, trim)
while (k--) {
s[--j] = ruby_digitmap[num % base];
num /= base;
if (!trim && j < 1) break;
if (!trim && j <= 1) break;
if (trim && i == 0 && num == 0) break;
}
}

View file

@ -18,6 +18,8 @@
#include <math.h>
#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
#define EXTENDSIGN(n, l) (((~0 << (n)) >> (((n)*(l)) % BITSPERDIG)) & ~(~0 << (n)))
static void fmt_setup _((char*,int,int,int,int));
@ -36,7 +38,7 @@ remove_sign_bits(str, base)
}
}
else if (base == 8) {
if (*t == '3') t++;
*t |= EXTENDSIGN(3, strlen(t));
while (*t == '7') {
t++;
}

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.6"
#define RUBY_RELEASE_DATE "2007-11-21"
#define RUBY_RELEASE_DATE "2007-11-28"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20071121
#define RUBY_RELEASE_CODE 20071128
#define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 11
#define RUBY_RELEASE_DAY 21
#define RUBY_RELEASE_DAY 28
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];