Exemple #1
0
// 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)))
}
Exemple #2
0
Fichier : int.go Projet : 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)))
}