The rect() is an inbuilt method in Ruby returns an array which consists of a real and an imaginary number.
Parameters: The function needs the number whose real and imaginary part is returned.
Return Value: It returns an array which consists of a real and an imaginary number.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.