summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-03 09:48:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-03 09:48:00 +0000
commit06d4e3b42d836b762c29cdc9dc7181caf14dcdec (patch)
tree4c85b1a55d024c59143e193b17e2444cb6873c6e /numeric.c
parent99839272a3cf1dfe69bd3bad26d96a915b905ef1 (diff)
990203
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 5a4d4930ac..21aecf73af 100644
--- a/numeric.c
+++ b/numeric.c
@@ -186,7 +186,9 @@ flo_to_s(flt)
char buf[24];
snprintf(buf, 24, "%.10g", RFLOAT(flt)->value);
- if (strchr(buf, '.') == 0 && strcmp(buf, "Inf") != 0) {
+ if (strchr(buf, '.') == 0 &&
+ strcmp(buf, "Inf") != 0 &&
+ strcmp(buf, "NaN") != 0) {
int len = strlen(buf);
char *ind = strchr(buf, 'e');