Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fractionSum(a, b)
- array = Array.new
- first = Rational(a[0],a[1])
- second = Rational(b[0], b[1])
- result = first + second
- array[0] = result.numerator
- array[1] = result.denominator
- return array
- end
Advertisement
Add Comment
Please, Sign In to add comment