popcount

package
v0.0.0-...-d4efea6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 0 Imported by: 0

README

Exercise 2.3: Rewrite PopCount to use a loop instead of a single expression. Compare the performance of the two versions. (Section 11.4 shows how to compare the performance of different implementations systematically.)

Exercise 2.4: Write a version of PopCount that counts bits by shifting its argument through 64 bit positions, testing the right most bit each time. Compare its performance to the table lookup version.

Exercise 2.5: The expression x&(x-1) clears the right most non-zero bit of x. Write a version of PopCount that counts bits by using this fact, and assess its performance.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopCount

func PopCount(x 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