Ruby | Vector eql?() function Last Updated : 07 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The eql?() is an inbuilt method in Ruby returns boolean value true if two vectors are same otherwise false Syntax: vec1.eql?(vec2) Parameters: The function accepts a single vector as parameters Return Value: It returns boolean value true if two vectors are same otherwise false Example 1: Ruby # Ruby program for eql?() method in Vector # Include matrix require "matrix" # Initialize the vector vec1 = Vector[1, 2, 3] vec2 = Vector[1, 2, 3] # Checks if two vectors are same or not puts vec1.eql?(vec2) Output: true Example 2: Ruby # Ruby program for eql?() method in Vector # Include matrix require "matrix" # Initialize the vector vec1 = Vector[1, 2, 3] vec2 = Vector[1, 1, 3] # Checks if two vectors are same or not puts vec1.eql?(vec2) Output: false Comment More infoAdvertise with us Next Article Ruby | Vector eql?() function G gopaldave Follow Improve Article Tags : Ruby Ruby-Methods Ruby Vector-class Similar Reads Ruby | Vector r() function The r() is an inbuilt method in Ruby returns the Pythagorean distance of the vector. Syntax: vec1.r() Parameters: The function accepts no parameter Return Value: It Pythagorean distance of the vector Example 1: Ruby # Ruby program for r() method in Vector # Include matrix require "matrix" 1 min read Ruby | Vector elements() function The elements() is an inbuilt method in Ruby returns the vector which is created using the array Syntax: Vector.elements(array) Parameters: The function accepts a parameter array Return Value: It returns the vector which is created using the array. Example 1: CPP #Ruby program for elements() method i 1 min read Ruby | Vector to_a() function The to_a() is an inbuilt method in Ruby returns the array with elements of vector Syntax: vec1.to_a() Parameters: The function accepts no parameter Return Value: It returns the array with elements of vector Example 1: Ruby # Ruby program for to_a() method in Vector # Include matrix require "mat 1 min read Ruby | Time eql?() function The eql?() is an inbuilt method in Ruby returns true if time and other time are both time objects with the same seconds and fractional seconds otherwise false Syntax: time.eql?() Parameters: The function accepts no parameter Return Value: It returns true if time and other time are both time objects 1 min read Ruby | Struct eql?() function The eql?() is an inbuilt method in Ruby returns true if other has the same struct subclass and has equal member values. Syntax: struct1.eql?(struct2) Parameters: The function accepts no parameter. Return Value: It returns boolean value true if both the given ranges are equal, else it returns false. 1 min read Like