even?()
public
Returns true if int is an even number.
Show source
/*
* call-seq:
* int.even? -> true or false
*
* Returns <code>true</code> if <i>int</i> is an even number.
*/
static VALUE
int_even_p(VALUE num)
{
if (rb_funcall(num, '%', 1, INT2FIX(2)) == INT2FIX(0)) {
return Qtrue;
}
return Qfalse;
}