Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TrailingZeros32 (0.28 sec)

  1. src/runtime/internal/sys/intrinsics_test.go

    			t.Errorf("TrailingZeros64(%d)=%d, want %d", x, got, i)
    		}
    	}
    }
    func TestTrailingZeros32(t *testing.T) {
    	for i := 0; i <= 32; i++ {
    		x := uint32(5) << uint(i)
    		if got := sys.TrailingZeros32(x); got != i {
    			t.Errorf("TrailingZeros32(%d)=%d, want %d", x, got, i)
    		}
    	}
    }
    
    func TestBswap64(t *testing.T) {
    	x := uint64(0x1122334455667788)
    	y := sys.Bswap64(x)
    	if y != 0x8877665544332211 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 984 bytes
    - Viewed (0)
  2. src/internal/fuzz/pcg.go

    			prod = uint64(v) * uint64(n)
    			low = uint32(prod)
    		}
    	}
    	return uint32(prod >> 32)
    }
    
    // exp2 generates n with probability 1/2^(n+1).
    func (r *pcgRand) exp2() int {
    	return bits.TrailingZeros32(r.uint32())
    }
    
    // bool generates a random bool.
    func (r *pcgRand) bool() bool {
    	return r.uint32()&1 == 0
    }
    
    // noCopy may be embedded into structs which must not be copied
    // after the first use.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:28:14 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. src/math/bits/make_examples.go

    		},
    		{
    			name: "TrailingZeros",
    			in:   14,
    			out:  [4]any{bits.TrailingZeros8(14), bits.TrailingZeros16(14), bits.TrailingZeros32(14), bits.TrailingZeros64(14)},
    		},
    		{
    			name: "OnesCount",
    			in:   14,
    			out:  [4]any{bits.OnesCount8(14), bits.OnesCount16(14), bits.OnesCount32(14), bits.OnesCount64(14)},
    		},
    		{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 3K bytes
    - Viewed (0)
Back to top