bits

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(a, b *big.Int) *big.Int

And returns the bitwise and of a and b (a & b in Go).

func Clear

func Clear(a, b *big.Int) *big.Int

Clear returns the bitwise and not of a and b (a &^ b in Go).

func Len

func Len(x uint64) int

Len returns the minimum number of bits required to represent x; the result is 0 for x == 0.

func OnesCount

func OnesCount(x uint64) int

OnesCount returns the number of one bits ("population count") in x.

func Or

func Or(a, b *big.Int) *big.Int

Or returns the bitwise or of a and b (a | b in Go).

func Reverse

func Reverse(x uint64) uint64

Reverse returns the value of x with its bits in reversed order.

func ReverseBytes

func ReverseBytes(x uint64) uint64

ReverseBytes returns the value of x with its bytes in reversed order.

func RotateLeft

func RotateLeft(x uint64, k int) uint64

RotateLeft returns the value of x rotated left by (k mod UintSize) bits. To rotate x right by k bits, call RotateLeft(x, -k).

func Xor

func Xor(a, b *big.Int) *big.Int

Xor returns the bitwise xor of a and b (a ^ b in Go).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL