11 if (IsNANorINF(n) && IsINF(n)) {
21 #include "ruby/config.h" 23 #if defined(HAVE_FINITE) && defined(HAVE_ISNAN) 51 static double zero(
void) {
return 0.0; }
52 static double one (
void) {
return 1.0; }
53 static double inf (
void) {
return one() / zero(); }
58 static double pinf = 0.0;
59 static double ninf = 0.0;
65 return memcmp(&n, &pinf,
sizeof n) == 0
66 ||
memcmp(&n, &ninf,
sizeof n) == 0;
RUBY_EXTERN int finite(double)
int memcmp(const void *s1, const void *s2, size_t len)