Discover Packages
cuelang.org/go
pkg
math
bits
package
Version:
v0.16.0
Opens a new window with list of versions in this module.
Published: Mar 3, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
func And(a, b *big.Int) *big.Int
func At(x *big.Int, i uint) (uint, error)
func Clear(a, b *big.Int) *big.Int
func Len(x *big.Int) int
func Lsh(x *big.Int, n uint) *big.Int
func OnesCount(x *big.Int) int
func Or(a, b *big.Int) *big.Int
func Rsh(x *big.Int, n uint) *big.Int
func Set(x *big.Int, i int, bit uint) *big.Int
func Xor(a, b *big.Int) *big.Int
And sets and returns a to the bitwise "and" of a and b.
At returns the value of the i'th bit of x.
Clear sets and returns a to the bitwise "and not" of a and b (a &^ b in Go).
Len returns the length of the absolute value of x in bits. The bit length
of 0 is 0.
Lsh sets and returns x shifted left by n bits.
OnesCount returns the number of one bits ("population count") in x.
Or sets and returns a to the bitwise "or" of a and b (a | b in Go).
Rsh sets and returns x shifted right by n bits.
Set sets and returns x with x's i'th bit set to b (0 or 1).
That is, if b is 1 Set returns x with its i'th bit set;
if b is 0 Set returns x with its i'th bit cleared.
Xor sets and returns a to the bitwise xor of a and b (a ^ b in Go).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.