Example #1
0
File: rat.go Project: ncw/gmp
// 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
}
Example #2
0
func (q *Rat) Inv(x *Rat) *Rat {
	x.doinit()
	q.doinit()
	C.mpq_inv(&q.i[0], &x.i[0])
	return q
}