pred()
public
Show source
/*
* call-seq:
* int.pred => integer
*
* Returns the <code>Integer</code> equal to <i>int</i> - 1.
*
* 1.pred #=> 0
* (-1).pred #=> -2
*/
static VALUE
int_pred(VALUE num)
{
if (FIXNUM_P(num)) {
long i = FIX2LONG(num) - 1;
return LONG2NUM(i);
}
return rb_funcall(num, '-', 1, INT2FIX(1));
}