views:

179

answers:

2

What is the difference between

10.6.to_i

and

10.6.to_int ?

+1  A: 

There is no difference. They are synonymous.

Marc W
to_i and to_int may give the same result for 10.6, but "42".to_i works, whereas "42".to_int raises a NoMethodError, for reasons given in kgiannakakis's link.
Andrew Grimm
+2  A: 

Read more about it here.

kgiannakakis