The quo()
method in Ruby can be used to get the quotient of two numbers. It is invoked by a float value. The parameter that it takes is the divisor.
flt.quo(no)
no
: This is the divisor or the value with which the float value flt
is divided. It is a mandatory parameter.
This method returns the quotient obtained from dividing flt
by no
.
# create some float valuesfloat_one = 3.145float_two = 100.7float_three = -2.5# use the quo() method and printed resultsputs float_one.quo(1)puts float_two.quo(5)puts float_three.quo(-2.5)
quo()
method on the float values and print the results to the console.