instance method Numeric#to_int

to_int -> Integer[permalink][rdoc][edit]

self.to_i と同じです。



(2+0i).to_int        # => 2
Rational(3).to_int   # => 3