コード例 #1
0
ファイル: gmp.go プロジェクト: edisonwsk/golang-on-cygwin
// Abs sets z to the absolute value of x and returns z.
func (z *Int) Abs(x *Int) *Int {
	x.doinit()
	z.doinit()
	C.mpz_abs(&z.i[0], &x.i[0])
	return z
}
コード例 #2
0
ファイル: int.go プロジェクト: jamesadney/gmp
// Abs sets z to the absolute value of x and returns z.
func (z *Int) Abs(x *Int) *Int {
	x.doinit()
	z.doinit()
	C.mpz_abs(z.ptr, x.ptr)
	return z
}