Logo

Programming-Idioms

History of Idiom 79 > diff from v6 to v7

Edit summary for version 7 by :

Version 6

2015-09-03, 11:46:07

Version 7

2015-09-03, 16:06:22

Idiom #79 Convert integer to floating point number

Declare floating point number y and initialize it with the value of integer x .

Idiom #79 Convert integer to floating point number

Declare floating point number y and initialize it with the value of integer x .

Code
y = x.to_f
Doc URL
http://ruby-doc.org/core-2.2.3/Fixnum.html#method-i-to_f