コード例 #1
0
ファイル: binomial_test.go プロジェクト: pombredanne/integer
func TestBinomial(t *testing.T) {
	var b big.Int
	for _, tc := range tcs {
		if a := binomial.Binomial(&b, tc.n, tc.k).String(); a != tc.s {
			t.Error("Binomial(%d, %d) expected %s, got %s", tc.n, tc.k, tc.s, a)
		}
	}
}
コード例 #2
0
ファイル: binomial_test.go プロジェクト: pombredanne/integer
func BenchmarkBinomial2e6(b *testing.B) {
	var c big.Int
	for i := 0; i < b.N; i++ {
		binomial.Binomial(&c, 2e6, uint(2e6)/3)
	}
}
コード例 #3
0
ファイル: binomial_test.go プロジェクト: pombredanne/integer
func BenchmarkBinomial1e5(b *testing.B) {
	var c big.Int
	for i := 0; i < b.N; i++ {
		binomial.Binomial(&c, 1e5, uint(1e5)/3)
	}
}