diff --git a/ChangeLog b/ChangeLog index 2b97f5b447..73e02abd48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 30 03:38:14 2010 NAKAMURA Usaku + + * numeric.c (fix_mul): the width of fixnum is same as long's on all + platforms. + Fri Apr 30 03:17:20 2010 Marc-Andre Lafortune * lib/matrix.rb: Improve algorithm for Matrix#determinant and diff --git a/numeric.c b/numeric.c index 02a3da6c43..f8b1d64095 100644 --- a/numeric.c +++ b/numeric.c @@ -2233,18 +2233,18 @@ fix_mul(VALUE x, VALUE y) /* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */ volatile #endif - SIGNED_VALUE a, b; -#if SIZEOF_VALUE * 2 <= SIZEOF_LONG_LONG + long a, b; +#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG LONG_LONG d; #else - SIGNED_VALUE c; + long c; VALUE r; #endif a = FIX2LONG(x); b = FIX2LONG(y); -#if SIZEOF_VALUE * 2 <= SIZEOF_LONG_LONG +#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG d = (LONG_LONG)a * b; if (FIXABLE(d)) return LONG2FIX(d); return rb_ll2inum(d);