bits

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: ISC Imports: 0 Imported by: 3

README

bits

GitHub tag (latest SemVer) PkgGoDev Go Report Card

bit manipulation

// PopcountUint returns the number of bits set in v
func PopcountUint(v uint) int
func PopcountUint64(v uint64) int

// Bitindex is equivalent to PopcountUint(bmap&(bitpos-1))
func Bitindex(bmap, bitpos uint) int

// PopcountIsIntrinsic returns true if popcount is implemented with a dedicated CPU instruction
func PopcountIsIntrinsic() bool

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bitindex

func Bitindex(bmap, bitpos uint) int

func PopcountIsIntrinsic

func PopcountIsIntrinsic() bool

func PopcountUint

func PopcountUint(v uint) int

func PopcountUint64

func PopcountUint64(v uint64) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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