1 2 3 4 5 6 7 8 9
/* public domain rewrite of finite(3) */ #include "ruby/missing.h" int finite(double n) { return !isnan(n) && !isinf(n); }