diff --git a/ChangeLog b/ChangeLog index c1853c37c3..f43646a6e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 1 22:15:01 2010 Tanaka Akira + + * numeric.c (rb_num2ulong): fix the lower limit for float. + [ruby-dev:41361] + Thu Jul 1 21:37:11 2010 Nobuyoshi Nakada * test/ruby/envutil.rb (EnvUtil#invoke_ruby): integrated with diff --git a/numeric.c b/numeric.c index 9ff193c0d5..993e1c46cf 100644 --- a/numeric.c +++ b/numeric.c @@ -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); }