public Method

Precision.prec(p1)

num.prec(klass)    a_klass

Converts self into an instance of klass. By default, prec invokes

klass.induced_from(num)

and returns its value. So, if klass.induced_from doesn’t return an instance of klass, it will be necessary to reimplement prec.

Source Code

/*
*  call-seq:
*   num.prec(klass)   => a_klass
*
*  Converts _self_ into an instance of _klass_. By default,
*  +prec+ invokes 
*
*     klass.induced_from(num)
*
*  and returns its value. So, if <code>klass.induced_from</code>
*  doesn't return an instance of _klass_, it will be necessary
*  to reimplement +prec+.
*/

static VALUE
prec_prec(x, klass)
   VALUE x, klass;
{
   return rb_funcall(klass, prc_if, 1, x);
}
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.