Flowdock
to_i() public

Returns the float truncated to an Integer.

1.2.to_i      #=> 1
(-1.2).to_i   #=> -1

Note that the limited precision of floating point arithmetic might lead to surprising results:

(0.3 / 0.1).to_i  #=> 2 (!)

#to_int is an alias for #to_i.

Show source
Register or log in to add new notes.