The integer part of self.

assert (0.0).to_i      == 0
assert (0.9).to_i      == 0
assert (-0.9).to_i     == 0
assert (9.9).to_i      == 9
assert (-9.9).to_i     == -9

Property definitions

core $ Numeric :: to_i
	# The integer part of `self`.
	#
	#     assert (0.0).to_i      == 0
	#     assert (0.9).to_i      == 0
	#     assert (-0.9).to_i     == 0
	#     assert (9.9).to_i      == 9
	#     assert (-9.9).to_i     == -9
	fun to_i: Int is abstract
lib/core/kernel.nit:452,2--459,26

core $ UInt32 :: to_i
	redef fun to_i is intern
lib/core/fixed_ints.nit:636,2--25

core $ Int8 :: to_i
	redef fun to_i is intern
lib/core/fixed_ints.nit:152,2--25

core $ Int16 :: to_i
	redef fun to_i is intern
lib/core/fixed_ints.nit:273,2--25

core $ UInt16 :: to_i
	redef fun to_i is intern
lib/core/fixed_ints.nit:394,2--25

core $ Int32 :: to_i
	redef fun to_i is intern
lib/core/fixed_ints.nit:515,2--25

gmp $ Ratio :: to_i
    #     assert("7/2".to_r.to_i == 3)
    redef fun to_i do
        var res = new NativeMPZ
        val.numref.tdiv_q(res, val.denref)
        return res.get_si
    end
lib/gmp/gmp.nit:371,5--376,7

core $ Byte :: to_i
	redef fun to_i is intern
lib/core/kernel.nit:654,2--25

core $ Float :: to_i
	redef fun to_i is intern
lib/core/kernel.nit:540,2--25

gmp $ BigInt :: to_i
    #     assert(11.to_bi.to_i == 11)
    redef fun to_i do return val.get_si
lib/gmp/gmp.nit:260,5--261,39

core $ Int :: to_i
	redef fun to_i do return self
lib/core/kernel.nit:751,2--30