示例#1
0
文件: rat.go 项目: ncw/gmp
// Set sets z to x (by making a copy of x) and returns z.
func (z *Rat) Set(x *Rat) *Rat {
	if z != x {
		z.doinit()
		C.mpq_set(&z.i[0], &x.i[0])
	}
	return z
}
示例#2
0
文件: gogmp.go 项目: i-neda/gogmp
// Set sets z = x and returns z.
func (q *Rat) Set(x *Rat) *Rat {
	q.doinit()
	C.mpq_set(&q.i[0], &x.i[0])
	return q
}