summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/object.c b/object.c
index 0e1c1a72ab..7e8b5e68e1 100644
--- a/object.c
+++ b/object.c
@@ -1140,6 +1140,10 @@ rb_cstr_to_dbl(p, badcheck)
while (ISSPACE(*p) || *p == '_') p++;
}
d = strtod(p, &end);
+ if (errno == ERANGE) {
+ rb_warn("Float %*s out of range", end-p, p);
+ errno = 0;
+ }
if (p == end) {
if (badcheck) {
bad:
@@ -1170,6 +1174,10 @@ rb_cstr_to_dbl(p, badcheck)
*n = '\0';
p = buf;
d = strtod(p, &end);
+ if (errno == ERANGE) {
+ rb_warn("Float %*s out of range", end-p, p);
+ errno = 0;
+ }
if (badcheck) {
if (p == end) goto bad;
while (*end && ISSPACE(*end)) end++;