public Method

Fixnum.modulo(p1)

fix % other          Numeric
fix.modulo(other)    Numeric

Returns fix modulo other. See Numeric.divmod for more information.

Source Code

/*
*  call-seq:
*    fix % other         => Numeric
*    fix.modulo(other)   => Numeric
*
*  Returns <code>fix</code> modulo <code>other</code>.
*  See <code>Numeric.divmod</code> for more information.
*/

static VALUE
fix_mod(x, y)
   VALUE x, y;
{
   if (FIXNUM_P(y)) {
       long mod;

       fixdivmod(FIX2LONG(x), FIX2LONG(y), 0, &mod);
       return LONG2NUM(mod);
   }
   return rb_num_coerce_bin(x, y);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.