Float divmod() is a float class method which return an array having the quotient and remainder on dividing two numbers.
Parameter: float values – dividend and divisor
Return: An array with quotient and remainder.
Division a/b : [2, 0.0] Division b/a : [0, 2.0]
source_file.rb:8:in `divmod': divided by 0 (ZeroDivisionError) from source_file.rb:8:in `' Division a/b : [0, 0.0]
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.