Logo

Programming-Idioms

History of Idiom 79 > diff from v33 to v34

Edit summary for version 34 by programming-idioms.org:
[Ruby] Bump doc version

Version 33

2018-11-14, 10:39:12

Version 34

2018-11-20, 20:26:09

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
Code
y = x.to_f
Doc URL
http://ruby-doc.org/core-2.2.3/Fixnum.html#method-i-to_f
Doc URL
http://ruby-doc.org/core-2.5.3/Integer.html#method-i-to_f