Skip to content

Instantly share code, notes, and snippets.

@headius

headius/.c Secret

Created March 21, 2018 21:28
Show Gist options
  • Save headius/99920294543eb3b6e3a1d61592c3ae9f to your computer and use it in GitHub Desktop.
Save headius/99920294543eb3b6e3a1d61592c3ae9f to your computer and use it in GitHub Desktop.
/*
* call-seq:
* cmp.finite? -> true or false
*
* Returns +true+ if +cmp+'s magnitude is a finite number,
* otherwise returns +false+.
*/
static VALUE
rb_complex_finite_p(VALUE self)
{
get_dat1(self);
if (f_finite_p(dat->real) && f_finite_p(dat->imag)) {
return Qtrue;
}
return Qfalse;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment