frexp(p1)
public
Returns a two-element array containing the normalized fraction (a Float) and exponent (a Fixnum) of numeric.
fraction, exponent = Math.frexp(1234)
fraction * 2**exponent
Show source
static VALUE
math_frexp(VALUE obj, VALUE x)
{
double d;
int exp;
Need_Float(x);
d = frexp(RFLOAT_VALUE(x), &exp);
return rb_assoc_new(DBL2NUM(d), INT2NUM(exp));
}