Skip to content

Instantly share code, notes, and snippets.

@takano32
Created November 17, 2009 11:44
Show Gist options
  • Select an option

  • Save takano32/236854 to your computer and use it in GitHub Desktop.

Select an option

Save takano32/236854 to your computer and use it in GitHub Desktop.
static VALUE
flo_is_finite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
#if HAVE_FINITE
if (!finite(value))
return Qfalse;
#else
if (isinf(value) || isnan(value))
return Qfalse;
#endif
return Qtrue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment