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

* numeric.c (fix_mul): fixed typo. fixed: [ruby-core:08885]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2006-09-17 01:42:28 +00:00
parent 6580c02605
commit cd5cfab0e7
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Sun Sep 17 10:42:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (fix_mul): fixed typo. fixed: [ruby-core:08885]
Sat Sep 16 19:47:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Sat Sep 16 19:47:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* README.EXT: should mention new macros: RSTRING_PTR, RSTRING_LEN, * README.EXT: should mention new macros: RSTRING_PTR, RSTRING_LEN,

View file

@ -1475,7 +1475,7 @@ rb_num2long(VALUE val)
char *s; char *s;
sprintf(buf, "%-.10g", RFLOAT(val)->value); sprintf(buf, "%-.10g", RFLOAT(val)->value);
if (s = strchr(buf, ' ')) *s = '\0'; if ((s = strchr(buf, ' ')) != 0) *s = '\0';
rb_raise(rb_eRangeError, "float %s out of range of integer", buf); rb_raise(rb_eRangeError, "float %s out of range of integer", buf);
} }
@ -1623,7 +1623,7 @@ rb_num2ll(VALUE val)
char *s; char *s;
sprintf(buf, "%-.10g", RFLOAT(val)->value); sprintf(buf, "%-.10g", RFLOAT(val)->value);
if (s = strchr(buf, ' ')) *s = '\0'; if ((s = strchr(buf, ' ')) != 0) *s = '\0';
rb_raise(rb_eRangeError, "float %s out of range of long long", buf); rb_raise(rb_eRangeError, "float %s out of range of long long", buf);
} }
@ -1991,7 +1991,7 @@ fix_mul(VALUE x, VALUE y)
#else #else
# define SQRT_LONG_MAX (1<<((SIZEOF_VALUE*CHAR_BIT-1)/2)) # define SQRT_LONG_MAX (1<<((SIZEOF_VALUE*CHAR_BIT-1)/2))
/*tests if N*N would overflow*/ /*tests if N*N would overflow*/
# define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((N)>=-SQRT_LONG_MAX)) # define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((n)>=-SQRT_LONG_MAX))
if (FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b)) if (FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b))
return LONG2FIX(a*b); return LONG2FIX(a*b);
c = a * b; c = a * b;