like in C and C++
double x
How to do it in ruby ?
Or to be in the type float?
I want to run
x=5/2
then
x=2.5
instead of
x=2
If at least one of the operands is a float, the result will be a float too.
5 / 2.0 # => 2.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With