Change-Id: Ie673f9665825a40281c2584d478ba1260f725856
Reviewed-on: https://go-review.googlesource.com/53357
Run-TryBot: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
// 64
// 63
}
+
+func ExampleOnesCount() {
+ fmt.Printf("%b\n", 14)
+ fmt.Println(bits.OnesCount(14))
+ // Output:
+ // 1110
+ // 3
+}
+
+func ExampleOnesCount8() {
+ fmt.Printf("%b\n", 14)
+ fmt.Println(bits.OnesCount8(14))
+ // Output:
+ // 1110
+ // 3
+}
+
+func ExampleOnesCount16() {
+ fmt.Printf("%b\n", 14)
+ fmt.Println(bits.OnesCount16(14))
+ // Output:
+ // 1110
+ // 3
+}
+
+func ExampleOnesCount32() {
+ fmt.Printf("%b\n", 14)
+ fmt.Println(bits.OnesCount32(14))
+ // Output:
+ // 1110
+ // 3
+}
+
+func ExampleOnesCount64() {
+ fmt.Printf("%b\n", 14)
+ fmt.Println(bits.OnesCount(14))
+ // Output:
+ // 1110
+ // 3
+}