mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (rb_num2ull): Cast double to unsigned LONG_LONG via
LONG_LONG instead of double to unsigned LONG_LONG directly. This is a challenge to fix a test_num2ull(TestNum2int) failure (NUM2ULL(-1.0) should be "18446744073709551615" but was "0") on Mac OS X with 32bit clang. http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-trunk-m32-o0/log/20130328T191100Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
023c7f6a37
commit
1950c1ce6c
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Fri Mar 29 06:39:42 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* numeric.c (rb_num2ull): Cast double to unsigned LONG_LONG via
|
||||||
|
LONG_LONG instead of double to unsigned LONG_LONG directly.
|
||||||
|
This is a challenge to fix a test_num2ull(TestNum2int)
|
||||||
|
failure (NUM2ULL(-1.0) should be "18446744073709551615" but was "0")
|
||||||
|
on Mac OS X with 32bit clang.
|
||||||
|
http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-trunk-m32-o0/log/20130328T191100Z.diff.html.gz
|
||||||
|
|
||||||
Fri Mar 29 00:54:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Mar 29 00:54:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be
|
* lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be
|
||||||
|
|
|
@ -2258,7 +2258,7 @@ rb_num2ull(VALUE val)
|
||||||
case T_FLOAT:
|
case T_FLOAT:
|
||||||
if (RFLOAT_VALUE(val) < ULLONG_MAX_PLUS_ONE
|
if (RFLOAT_VALUE(val) < ULLONG_MAX_PLUS_ONE
|
||||||
&& LLONG_MIN_MINUS_ONE_IS_LESS_THAN(RFLOAT_VALUE(val))) {
|
&& LLONG_MIN_MINUS_ONE_IS_LESS_THAN(RFLOAT_VALUE(val))) {
|
||||||
return (unsigned LONG_LONG)(RFLOAT_VALUE(val));
|
return (unsigned LONG_LONG)(LONG_LONG)(RFLOAT_VALUE(val));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char buf[24];
|
char buf[24];
|
||||||
|
|
Loading…
Reference in a new issue