mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value):
shut up warning. * rational.c (nurat_to_f): no need for forceful warning when converting to float. overflow is a nature of float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a60856f010
commit
78008d342e
4 changed files with 15 additions and 6 deletions
|
@ -1130,7 +1130,7 @@ nurat_to_f(VALUE self)
|
|||
e = (int)(ne - de);
|
||||
|
||||
if ((e > DBL_MAX_EXP) || (e < DBL_MIN_EXP)) {
|
||||
rb_warn("%s out of Float range", rb_obj_classname(self));
|
||||
rb_warning("%s out of Float range", rb_obj_classname(self));
|
||||
return rb_float_new(e > 0 ? HUGE_VAL : 0.0);
|
||||
}
|
||||
|
||||
|
@ -1140,7 +1140,7 @@ nurat_to_f(VALUE self)
|
|||
f = ldexp(f, e);
|
||||
|
||||
if (isinf(f) || isnan(f))
|
||||
rb_warn("%s out of Float range", rb_obj_classname(self));
|
||||
rb_warning("%s out of Float range", rb_obj_classname(self));
|
||||
|
||||
return rb_float_new(f);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue