Ruby  2.5.0dev(2017-10-22revision60238)
isnan.c
Go to the documentation of this file.
1 /* public domain rewrite of isnan(3) */
2 
3 #include "ruby/missing.h"
4 
5 /*
6  * isnan() may be a macro, a function or both.
7  * (The C99 standard defines that isnan() is a macro, though.)
8  * http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html
9  *
10  * macro only: uClibc
11  * both: GNU libc
12  *
13  * This file is compile if no isnan() function is available.
14  * (autoconf AC_REPLACE_FUNCS detects only the function.)
15  * The macro is detected by following #ifndef.
16  */
17 
18 #ifndef isnan
19 static int double_ne(double n1, double n2);
20 
21 int
22 isnan(double n)
23 {
24  return double_ne(n, n);
25 }
26 
27 static int
28 double_ne(double n1, double n2)
29 {
30  return n1 != n2;
31 }
32 #endif
int isnan(double n)
Definition: isnan.c:22