mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (fix_mul): the width of fixnum is same as long's on all
platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0a3c78face
commit
34f182f7b2
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Apr 30 03:38:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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 <ruby-core@marc-andre.ca>
|
Fri Apr 30 03:17:20 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* lib/matrix.rb: Improve algorithm for Matrix#determinant and
|
* lib/matrix.rb: Improve algorithm for Matrix#determinant and
|
||||||
|
|
|
@ -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] */
|
/* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */
|
||||||
volatile
|
volatile
|
||||||
#endif
|
#endif
|
||||||
SIGNED_VALUE a, b;
|
long a, b;
|
||||||
#if SIZEOF_VALUE * 2 <= SIZEOF_LONG_LONG
|
#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
|
||||||
LONG_LONG d;
|
LONG_LONG d;
|
||||||
#else
|
#else
|
||||||
SIGNED_VALUE c;
|
long c;
|
||||||
VALUE r;
|
VALUE r;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
a = FIX2LONG(x);
|
a = FIX2LONG(x);
|
||||||
b = FIX2LONG(y);
|
b = FIX2LONG(y);
|
||||||
|
|
||||||
#if SIZEOF_VALUE * 2 <= SIZEOF_LONG_LONG
|
#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
|
||||||
d = (LONG_LONG)a * b;
|
d = (LONG_LONG)a * b;
|
||||||
if (FIXABLE(d)) return LONG2FIX(d);
|
if (FIXABLE(d)) return LONG2FIX(d);
|
||||||
return rb_ll2inum(d);
|
return rb_ll2inum(d);
|
||||||
|
|
Loading…
Add table
Reference in a new issue