public Method

Float.**(p1)

flt ** other => float

Raises float the other power.

Source Code

/*
* call-seq:
*
*  flt ** other   => float
*
* Raises <code>float</code> the <code>other</code> power.
*/

static VALUE
flo_pow(x, y)
   VALUE x, y;
{
   switch (TYPE(y)) {
     case T_FIXNUM:
       return rb_float_new(pow(RFLOAT(x)->value, (double)FIX2LONG(y)));
     case T_BIGNUM:
       return rb_float_new(pow(RFLOAT(x)->value, rb_big2dbl(y)));
     case T_FLOAT:
       return rb_float_new(pow(RFLOAT(x)->value, RFLOAT(y)->value));
     default:
       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.