Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fractionMultiplication(a, b)
- output_array = Array.new
- top = a[0] * b[0]
- bottom = a[1] * b[1]
- divisor = top.gcd(bottom)
- output_array[0] = top / divisor
- output_array[1] = bottom / divisor
- return output_array
- end
Advertisement
Add Comment
Please, Sign In to add comment