// Inv sets z to 1/x and returns z. func (z *Rat) Inv(x *Rat) *Rat { z.doinit() x.doinit() if x.Sign() == 0 { panic("division by zero") } C.mpq_inv(&z.i[0], &x.i[0]) return z }
func (q *Rat) Inv(x *Rat) *Rat { x.doinit() q.doinit() C.mpq_inv(&q.i[0], &x.i[0]) return q }