Logo

Programming-Idioms

History of Idiom 79 > diff from v34 to v35

Edit summary for version 35 by programming-idioms.org:
Admin deletes impl 2459

Version 34

2018-11-20, 20:26:09

Version 35

2018-11-20, 20:26:30

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.5.3/Integer.html#method-i-to_f