Esempio n. 1
0
func TestFunction(t *testing.T) {
	var f big.Int
	for _, tc := range tcs {
		if sf := swing.SwingingFactorial(&f, tc.n).String(); sf != tc.s {
			t.Errorf("wrong swinging factorial for %d. Expected %s, got %s:",
				tc.n, tc.s, sf)
		}
	}
}
Esempio n. 2
0
func BenchmarkFunction1e6(b *testing.B) {
	var f big.Int
	for i := 0; i < b.N; i++ {
		swing.SwingingFactorial(&f, 1e6)
	}
}