The to_r() is an inbuilt function in Ruby returns it’s own value Syntax: rat.to_r() Parameters: The function accepts no parameter Return Value: It returns it’s… Read More
Category Archives: Ruby
The to_s() is an inbuilt function in Ruby returns value as string Syntax: rat.to_s() Parameters: The function accepts no parameter Return Value: It returns value… Read More
The truncate() is an inbuilt function in Ruby returns rat truncated (toward zero) to a precision of ndigits decimal digits. ndigits by default is 0.… Read More
The remainder() is an inbuilt method in Ruby returns the remainder when num1 is divided by num2. Syntax: num1.remainder(num2) Parameters: The function needs num1 and… Read More
The abs() is an inbuilt function in Ruby returns the absolute value of rational. Syntax: rational.abs() Parameters: The function accepts no parameter Return Value: It… Read More
The rectangular() is an inbuilt method in Ruby returns an array which consists of a real and an imaginary number. Syntax: num.rectangular() Parameters: The function… Read More
The == is an inbuilt method in Ruby returns boolean value true if two rational numbers are same otherwise false Syntax: rat1 == rat2 Parameters:… Read More
The rect() is an inbuilt method in Ruby returns an array which consists of a real and an imaginary number. Syntax: num.rect() Parameters: The function… Read More
The <=> is an inbuilt method in Ruby returns -1, 0, or +1 depending on whether rational is less than, equal to, or greater than… Read More
The real() is an inbuilt method in Ruby returns the real part of the given number. Syntax: num.real() Parameters: The function needs the number whose… Read More
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:… Read More
The ** is an inbuilt method in Ruby returns the rational number by performing exponentiation between two rational numbers. Syntax: rat1 ** rat2 Parameters: The… Read More
The – is an inbuilt method in Ruby returns the rational number by performing subtraction between two rational numbers. Syntax: rat1 – rat2 Parameters: The… Read More
The + is an inbuilt method in Ruby returns the rational number by performing addition between two rational numbers. Syntax: rat1 + rat2Parameters: The function… Read More
The / is an inbuilt method in Ruby returns the rational number by performing division between two rational numbers. Syntax: rat1 / rat2 Parameters: The… Read More