(api frontend.API, other *RationalNumber)
| 18 | } |
| 19 | |
| 20 | func (r *RationalNumber) Add(api frontend.API, other *RationalNumber) RationalNumber { |
| 21 | return RationalNumber{ |
| 22 | Numerator: api.Add(api.Mul(r.Numerator, other.Denominator), api.Mul(other.Numerator, r.Denominator)), |
| 23 | Denominator: api.Mul(r.Denominator, other.Denominator), |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | // Construct a binary summation tree to sum all the values |
| 28 | func SumRationalNumbers(api frontend.API, vs []RationalNumber) RationalNumber { |
no test coverage detected