how to initialize a variable to the type "double" in ruby -
like in c , c++
double x how in ruby ?
or in type float?
i want run
x=5/2 then
x=2.5 instead of
x=2
if 1 operands float, result float too.
5 / 2.0 # => 2.5 like in c , c++
double x how in ruby ?
or in type float?
i want run
x=5/2 then
x=2.5 instead of
x=2
if 1 operands float, result float too.
5 / 2.0 # => 2.5
Comments
Post a Comment