Ruby | Numeric quo() function
Last Updated :
19 Mar, 2024
The quo() is an inbuilt method in Ruby returns the most exact division, whether it be a float or a rational one.
Syntax: num.quo()
Parameters: The function needs a number which is to be checked.
Return Value: It returns the most exact division.
Example 1:
num1 = 10
num2 = 7
puts num1.quo(num2)
|
Output:
10/7
Example 2:
num1 = 10
num2 = 5
puts num1.quo(num2)
|
Output:
2/1
Share your thoughts in the comments
Please Login to comment...