Ruby | Numeric eql?() function Last Updated : 19 Mar, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The eql?() is an inbuilt method in Ruby returns a boolean value. It returns true if both the numbers are equal, else it returns false. Syntax: num1.eql?(num2) Parameters: The function needs two number whose comparison is to be done. Return Value: It returns returns true if both are equal, else it returns false. Example 1: Ruby # Ruby program for eql?() method in Numeric # Initialize a number num1 = 1.7 num2 = 1.7 # Function used res = num1.eql?(num2) # Prints eql or not puts res Output: true Example 2: Ruby # Ruby program for eql?() method in Numeric # Initialize a number num1 = 15 num2 = 19 # Function used res = num1.eql?(num2) # Prints eql or not puts res Output: false Comment More infoAdvertise with us Next Article Ruby | Numeric eql?() function G gopaldave Follow Improve Article Tags : Ruby Ruby-Methods Ruby Numeric-class Similar Reads Ruby | Numeric ceil() function 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 precision of n digits of the decimal part. Syntax: num.ceil(n digits) Parameters: The function needs a number and n digits to which the precision of decimal digits is 1 min read Ruby | Numeric abs() function The abs is an inbuilt method in Ruby returns the absolute value of a number.  Syntax: num.abs Parameters: The function needs the number whose absolute value is to be returned. Return Value: It returns the absolute value of a numbers. Example 1:  Ruby # Ruby program for abs() method in Numeric # I 1 min read Ruby | Numeric floor() function The floor() is an inbuilt method in Ruby returns a number less than or equal to the given number with a precision of the given number of digits after the decimal point. In case the number of digits is not given, the default value is taken to be zero. Syntax: num.floor(ndigits) Parameters: The functi 1 min read Ruby | Numeric arg() function The arg() is an inbuilt method in Ruby returns 0 if the number is positive, else it returns a float value which is equal to pi. Syntax: num.arg() Parameters: The function needs a number. Return Value: It returns 0 if the number is positive, else it returns a float value which is equal to pi. . Exa 1 min read Ruby | Numeric angle() function The angle() is an inbuilt method in Ruby returns 0 if the number is positive, else it returns a float value which is equal to pi. Syntax: num.angle() Parameters: The function needs a number. Return Value: It returns 0 if the number is positive, else it returns a float value which is equal to pi. . 1 min read Like