ldexp(p1, p2)
public
Returns the value of flt*(2**int).
fraction, exponent = Math.frexp(1234)
Math.ldexp(fraction, exponent)
Show source
/*
* call-seq:
* Math.ldexp(flt, int) -> float
*
* Returns the value of <i>flt</i>*(2**<i>int</i>).
*
* fraction, exponent = Math.frexp(1234)
* Math.ldexp(fraction, exponent) #=> 1234.0
*/
static VALUE
math_ldexp(obj, x, n)
VALUE obj, x, n;
{
Need_Float(x);
return rb_float_new(ldexp(RFLOAT(x)->value, NUM2INT(n)));
}