Esempio n. 1
0
// SetInt sets q to x and returns q.
func (q *Rat) SetInt(x *Int) *Rat {
	q.doinit()
	x.doinit()
	C.mpq_set_z(&q.i[0], &x.i[0])
	return q
}
Esempio n. 2
0
File: rat.go Progetto: ncw/gmp
// SetInt sets z to x (by making a copy of x) and returns z.
func (z *Rat) SetInt(x *Int) *Rat {
	z.doinit()
	// FIXME copying? or referencing?
	C.mpq_set_z(&z.i[0], &x.i[0])
	return z
}