Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestUniformDistribution (0.14 sec)

  1. staging/src/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding_test.go

    // positive and m to be in the range [0, n] and requires the answer to
    // fit in an int
    func ff(n, m int) int {
    	ans := 1
    	for f := n; f > n-m; f-- {
    		ans *= f
    	}
    	return ans
    }
    
    func TestUniformDistribution(t *testing.T) {
    	const spare = 64 - MaxHashBits
    	tests := []struct {
    		deckSize, handSize int
    		hashMax            int
    	}{
    		{64, 3, 1 << uint(math.Ceil(math.Log2(float64(ff(64, 3))))+spare)},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 25 06:44:08 UTC 2021
    - 6.7K bytes
    - Viewed (0)
Back to top