Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestBitLen16 (0.12 sec)

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

    	for i := 0; i <= 32; i++ {
    		got := bits.Len32(1 << i)
    		want := i + 1
    		if want == 33 {
    			want = 0
    		}
    		if got != want {
    			t.Errorf("Len32(1<<%d) = %d, want %d", i, got, want)
    		}
    	}
    }
    
    func TestBitLen16(t *testing.T) {
    	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)
    		}
    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