00001 /* public domain rewrite of isnan(3) */ 00002 00003 #include "ruby/missing.h" 00004 00005 /* 00006 * isnan() may be a macro, a function or both. 00007 * (The C99 standard defines that isnan() is a macro, though.) 00008 * http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html 00009 * 00010 * macro only: uClibc 00011 * both: GNU libc 00012 * 00013 * This file is compile if no isnan() function is available. 00014 * (autoconf AC_REPLACE_FUNCS detects only the function.) 00015 * The macro is detected by following #ifndef. 00016 */ 00017 00018 #ifndef isnan 00019 static int double_ne(double n1, double n2); 00020 00021 int 00022 isnan(double n) 00023 { 00024 return double_ne(n, n); 00025 } 00026 00027 static int 00028 double_ne(double n1, double n2) 00029 { 00030 return n1 != n2; 00031 } 00032 #endif 00033
1.6.1