Skip to content
Related Articles

Related Articles

Ruby | Numeric quo() function
  • Last Updated : 06 Jan, 2020

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:



filter_none

edit
close

play_arrow

link
brightness_4
code

# Ruby program for quo()
# method in Numeric
  
# Initialize a number 
num1 = 10
num2 = 7
  
# Prints the quo
puts num1.quo(num2)

chevron_right


Output:

10/7

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# Ruby program for quo()
# method in Numeric
  
# Initialize a number 
num1 = 10
num2 = 5
  
# Prints the quo
puts num1.quo(num2)

chevron_right


Output:

2/1
My Personal Notes arrow_drop_up
Recommended Articles
Page :