mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* object.c (rb_cstr_to_dbl): no need for forceful warning when
converting to float. overflow is a nature of float values. * parse.y (parser_yylex): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
880a96c795
commit
1d53405b31
3 changed files with 10 additions and 3 deletions
|
@ -7,6 +7,13 @@ Thu May 15 15:33:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* file.c (rb_file_s_extname): ditto.
|
* file.c (rb_file_s_extname): ditto.
|
||||||
|
|
||||||
|
Thu May 15 13:43:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* object.c (rb_cstr_to_dbl): no need for forceful warning when
|
||||||
|
converting to float. overflow is a nature of float values.
|
||||||
|
|
||||||
|
* parse.y (parser_yylex): ditto.
|
||||||
|
|
||||||
Thu May 15 13:23:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Thu May 15 13:23:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* re.c (rb_reg_prepare_enc): error condition was updated for non
|
* re.c (rb_reg_prepare_enc): error condition was updated for non
|
||||||
|
|
4
object.c
4
object.c
|
@ -2048,7 +2048,7 @@ rb_cstr_to_dbl(const char *p, int badcheck)
|
||||||
d = strtod(p, &end);
|
d = strtod(p, &end);
|
||||||
if (errno == ERANGE) {
|
if (errno == ERANGE) {
|
||||||
OutOfRange();
|
OutOfRange();
|
||||||
rb_warn("Float %.*s%s out of range", w, p, ellipsis);
|
rb_warning("Float %.*s%s out of range", w, p, ellipsis);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
if (p == end) {
|
if (p == end) {
|
||||||
|
@ -2086,7 +2086,7 @@ rb_cstr_to_dbl(const char *p, int badcheck)
|
||||||
d = strtod(p, &end);
|
d = strtod(p, &end);
|
||||||
if (errno == ERANGE) {
|
if (errno == ERANGE) {
|
||||||
OutOfRange();
|
OutOfRange();
|
||||||
rb_warn("Float %.*s%s out of range", w, p, ellipsis);
|
rb_warning("Float %.*s%s out of range", w, p, ellipsis);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
if (badcheck) {
|
if (badcheck) {
|
||||||
|
|
2
parse.y
2
parse.y
|
@ -6777,7 +6777,7 @@ parser_yylex(struct parser_params *parser)
|
||||||
if (is_float) {
|
if (is_float) {
|
||||||
double d = strtod(tok(), 0);
|
double d = strtod(tok(), 0);
|
||||||
if (errno == ERANGE) {
|
if (errno == ERANGE) {
|
||||||
rb_warnS("Float %s out of range", tok());
|
rb_warningS("Float %s out of range", tok());
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
set_yylval_literal(DOUBLE2NUM(d));
|
set_yylval_literal(DOUBLE2NUM(d));
|
||||||
|
|
Loading…
Add table
Reference in a new issue