Ruby  2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
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
isnan
int isnan(double n)
Definition: isnan.c:22
missing.h
n
const char size_t n
Definition: rb_mjit_min_header-2.7.2.h:5452