コード例 #1
0
ファイル: int.go プロジェクト: locusf/gmp
// Bit returns the value of the i'th bit of x. That is, it
// returns (x>>i)&1. The bit index i must be >= 0.
func (x *Int) Bit(i int) uint {
	x.doinit()
	return uint(C._mpz_tstbit(&x.i[0], C.ulong(i)))
}
コード例 #2
0
ファイル: int.go プロジェクト: ncw/gmp
// Bit returns the value of the i'th bit of z. That is, it
// returns (z>>i)&1. The bit index i must be >= 0.
func (z *Int) Bit(i int) uint {
	z.doinit()
	return uint(C._mpz_tstbit(&z.i[0], C.ulong(i)))
}