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