From 06d4e3b42d836b762c29cdc9dc7181caf14dcdec Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 3 Feb 1999 09:48:00 +0000 Subject: 990203 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numeric.c') 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'); -- cgit v1.2.3