= private = protected
to_i()
Returns the truncated value as an integer.
Equivalent to
rat.truncate.
For example:
Rational(2, 3).to_i #=> 0 Rational(3).to_i #=> 3 Rational(300.6).to_i #=> 300 Rational(98,71).to_i #=> 1 Rational(-30,2).to_i #=> -15
static VALUE nurat_truncate(VALUE self) { get_dat1(self); if (f_negative_p(dat->num)) return f_negate(f_idiv(f_negate(dat->num), dat->den)); return f_idiv(dat->num, dat->den); }