+(p1)
public
Adds big and other, returning the result.
Show source
/*
* call-seq:
* big + other => Numeric
*
* Adds big and other, returning the result.
*/
VALUE
rb_big_plus(x, y)
VALUE x, y;
{
switch (TYPE(y)) {
case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
/* fall through */
case T_BIGNUM:
return bignorm(bigadd(x, y, 1));
case T_FLOAT:
return rb_float_new(rb_big2dbl(x) + RFLOAT(y)->value);
default:
return rb_num_coerce_bin(x, y);
}
}