Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestBitLen8 (0.09 sec)

  1. src/cmd/compile/internal/test/intrinsics_test.go

    	for i := 0; i <= 16; i++ {
    		got := bits.Len16(1 << i)
    		want := i + 1
    		if want == 17 {
    			want = 0
    		}
    		if got != want {
    			t.Errorf("Len16(1<<%d) = %d, want %d", i, got, want)
    		}
    	}
    }
    
    func TestBitLen8(t *testing.T) {
    	for i := 0; i <= 8; i++ {
    		got := bits.Len8(1 << i)
    		want := i + 1
    		if want == 9 {
    			want = 0
    		}
    		if got != want {
    			t.Errorf("Len8(1<<%d) = %d, want %d", i, got, want)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 03 18:33:02 UTC 2022
    - 1.1K bytes
    - Viewed (0)
Back to top