mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (rb_num2ulong): fix the lower limit for float.
[ruby-dev:41361] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e12c43ee8c
commit
8bab1aff2c
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Jul 1 22:15:01 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* numeric.c (rb_num2ulong): fix the lower limit for float.
|
||||
[ruby-dev:41361]
|
||||
|
||||
Thu Jul 1 21:37:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/ruby/envutil.rb (EnvUtil#invoke_ruby): integrated with
|
||||
|
|
|
@ -1729,7 +1729,7 @@ rb_num2ulong(VALUE val)
|
|||
|
||||
switch (TYPE(val)) {
|
||||
case T_FLOAT:
|
||||
if (RFLOAT_VALUE(val) <= (double)LONG_MAX
|
||||
if (RFLOAT_VALUE(val) <= (double)ULONG_MAX
|
||||
&& RFLOAT_VALUE(val) >= (double)LONG_MIN) {
|
||||
return (VALUE)RFLOAT_VALUE(val);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue