Skip to content

Tag Archives: Ruby Numeric-class

The truncate() is an inbuilt method in Ruby returns a number rounded toward zero with a precision of the given number of digits after the… Read More
The to_int() is an inbuilt method in Ruby returns the integer part of the given number. Syntax: num.to_int() Parameters: The function needs the number whose… Read More
The to_c() is an inbuilt method in Ruby returns a complex number with the num. Syntax: num.to_c() Parameters: The function needs the number which is… Read More
The round() is an inbuilt method in Ruby returns a number rounded to a number nearest to the given number with a precision of the… 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 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 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 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 phase() is an inbuilt method in Ruby returns 0 if the value is positive, else it returns a float value pi. Syntax: num.phase() Parameters:… Read More
The numerator() is an inbuilt method in Ruby returns the numerator. Syntax: num.numerator() Parameters: The function needs a number which is to be checked. Return… Read More
The nonzero?() is an inbuilt method in Ruby returns self if the number is non-zero, else it returns nil. Syntax: num.nonzero?() Parameters: The function needs… Read More
The infinite?() is an inbuilt method in Ruby returns nil if the number is finite. It returns -1 and +1 if the number is -infinity… Read More
The ceil() is an inbuilt method in Ruby returns the smallest number which is greater than or equal to the given number by keeping a… Read More
The finite?() is an inbuilt method in Ruby returns a boolean value. It returns true if the number is a finite one, else it returns… Read More