예제 #1
0
func TestPrime(t *testing.T) {
	var f big.Int
	for _, tc := range tcs {
		if fs := prime.Factorial(&f, tc.n).String(); fs != tc.s {
			t.Errorf("%d! incorrect.  expected %s, got %s", tc.n, tc.s, fs)
		}
	}
}
예제 #2
0
func Benchmark1e5(b *testing.B) {
	var f big.Int
	for i := 0; i < b.N; i++ {
		prime.Factorial(&f, 1e5)
	}
}