frexp(p1)
Returns a two-element array containing the normalized fraction (a Float) and exponent (an Integer) of x.
fraction, exponent = Math.frexp(1234) #=> [0.6025390625, 11] fraction * 2**exponent #=> 1234.0
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)); }