End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Float#denominator
flo.denominator → integer
rational.c
View on GitHub ↗
VALUE
rb_float_denominator(VALUE self)
{
double d = RFLOAT_VALUE(self);
VALUE r;
if (!isfinite(d))
return INT2FIX(1);
r = float_to_r(self);
return nurat_denominator(r);
}
Returns the denominator (always positive). The result is machine dependent.
See also Float#numerator.