(api frontend.API, other *RationalNumber)
| 14 | } |
| 15 | |
| 16 | func (r *RationalNumber) Add(api frontend.API, other *RationalNumber) RationalNumber { |
| 17 | return RationalNumber{ |
| 18 | Numerator: api.Add(api.Mul(r.Numerator, other.Denominator), api.Mul(other.Numerator, r.Denominator)), |
| 19 | Denominator: api.Mul(r.Denominator, other.Denominator), |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | // 0 is considered a power of 2 in this case |
| 24 | func IsPowerOf2(n int) bool { |
no test coverage detected