summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-21 12:26:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-21 12:26:08 +0000
commit71e0bb92d13af4f8aabb79689a3a7edb81b6680a (patch)
tree1cb8b3a6f9623e1714715ac5986c6ac339830f3f /numeric.c
parent3819849ac195b9034e0cb9f6101978adfc18b6f0 (diff)
* numeric.c (flo_is_finite_p): use finite() if available.
* win32/win32.h (isinf, isnan): define as macro. [ruby-win32:00533] * bcc32/Makefile.sub, win32/Makefile.sub: no longer use missing/isinf.c, missing/isnan.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index e77c09f..8a76b8f 100644
--- a/numeric.c
+++ b/numeric.c
@@ -758,9 +758,14 @@ flo_is_finite_p(num)
{
double value = RFLOAT(num)->value;
+#if HAVE_FINITE
+ if (!finite(value))
+ return Qfalse;
+#else
if (isinf(value) || isnan(value))
return Qfalse;
-
+#endif
+
return Qtrue;
}