Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd)
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
19static int double_ne(double n1, double n2);
20
21int
22isnan(double n)
23{
24 return double_ne(n, n);
25}
26
27static int
28double_ne(double n1, double n2)
29{
30 return n1 != n2;
31}
32#endif
int isnan(double n)
Definition: isnan.c:22
const char size_t n