Data Structure
Java
Python
HTML
Interview Preparation
Tutorials
Courses
Tracks
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Python
19.6K+ articles
Experiences
15.8K+ articles
Interview Experiences
14.2K+ articles
School Learning
11.1K+ articles
JavaScript
9.9K+ articles
Java
9.3K+ articles
Ruby
1.2K+ articles
Ruby-Methods
926+ articles
Ruby Rational-class
25 posts
Recent Articles
Popular Articles
Ruby | Rational rational() function()
Last Updated: 12 July 2025
The Rational() is an inbuilt method in Ruby returns the rational number of the form a/b.Syntax: Rational(num, den)Parameters: The function accepts two parameters which re...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational rationalize() function
Last Updated: 12 July 2025
The rationalize() is an inbuilt function in Ruby returns a simpler approximation of the value if the optional argument eps is given (rat-|eps| = result = rat+|eps|) other...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational round() function
Last Updated: 12 July 2025
The round() is an inbuilt function in Ruby returns rational rounded to the nearest value with a precision of ndigits decimal digits. ndigits by default is 0. It returns a...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational positive?() function
Last Updated: 12 July 2025
The positive?() is an inbuilt function in Ruby returns boolean value true if rational number is greater than zero otherwise falseSyntax: rat.positive?()Parameters: The fu...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational negative?() function
Last Updated: 12 July 2025
The negative?() is an inbuilt function in Ruby returns boolean value true if rational number is less than zero otherwise false.Syntax: rat.negative?()Parameters: The func...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational quo() function
Last Updated: 12 July 2025
The quo() is an inbuilt function in Ruby returns the rational number by performing division.Syntax: rat1.quo(rat2)Parameters: The function accepts a single parameterRetur...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational numerator() function
Last Updated: 12 July 2025
The numerator() is an inbuilt function in Ruby returns the numerator.Syntax: rat.numerator()Parameters: The function accepts no parameterReturn Value: It returns the nume...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational inspect() function
Last Updated: 12 July 2025
The inspect() is an inbuilt function in Ruby returns the value as a string.Syntax: rat.inspect()Parameters: The function accepts no parameterReturn Value: It returns the ...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational floor() function
Last Updated: 12 July 2025
The floor() is an inbuilt function in Ruby returns the largest number less than or equal to rat with a precision of ndigits decimal digits. ndigits by default is 0. It re...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational fdiv() function
Last Updated: 12 July 2025
The fdiv() is an inbuilt function in Ruby returns float by performing division. Syntax: rat.fdiv(numeric)Parameters: The function accepts a single parameterReturn Value: I...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational denominator() function
Last Updated: 12 July 2025
The denominator() is an inbuilt function in Ruby returns the denominator which is always positive.Syntax: rat.denominator()Parameters: The function accepts no parameterRe...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational ceil() function
Last Updated: 12 July 2025
The ceil() is an inbuilt function in Ruby returns the smallest number greater than or equal to rat with a precision of ndigits decimal digits. ndigits by default is 0. It...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational to_f() function
Last Updated: 12 July 2025
The to_f() is an inbuilt function in Ruby returns the float valueSyntax: rat.to_f()Parameters: The function accepts no parameterReturn Value: It returns the float valueEx...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational to_i() function
Last Updated: 12 July 2025
The to_i() is an inbuilt function in Ruby returns the truncated integer valueSyntax: rat.to_i()Parameters: The function accepts no parameterReturn Value: It returns the t...
read more
Ruby
Ruby-Methods
Ruby Rational-class
Ruby | Rational to_r() function
Last Updated: 12 July 2025
The to_r() is an inbuilt function in Ruby returns it's own valueSyntax: rat.to_r()Parameters: The function accepts no parameterReturn Value: It returns it's own valueExam...
read more
Ruby
Ruby-Methods
Ruby Rational-class
1
2