package bits

import "cuelang.org/go/pkg/math/bits"

Index

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).

Source Files

manual.go

Version
v0.0.4-rc1
Published
Jul 1, 2019
Platform
darwin/amd64
Imports
2 packages
Last checked
41 minutes ago

Tools for package owners.