예제 #1
0
파일: gogmp.go 프로젝트: i-neda/gogmp
func (q *Rat) Abs(x *Rat) *Rat {
	x.doinit()
	q.doinit()
	C.mpq_abs(&q.i[0], &x.i[0])
	return q
}
예제 #2
0
파일: rat.go 프로젝트: ncw/gmp
// Abs sets z to |x| (the absolute value of x) and returns z.
func (z *Rat) Abs(x *Rat) *Rat {
	z.doinit()
	C.mpq_abs(&z.i[0], &x.i[0])
	return z
}