func TestDoubleFactorialS(t *testing.T) { p := swing.New(tcs[len(tcs)-1].n + 1) d := new(big.Int) answer := new(big.Int) for _, tc := range tcs { if _, ok := answer.SetString(tc.s, 10); !ok { t.Error("invalid test case", tc) continue } switch _ = double.DoubleFactorialS(d, p, tc.n); { case d == nil: t.Error("nil result. test case", tc) case d.Cmp(answer) != 0: t.Log("wrong answer, test case", tc) t.Error("got", answer) } } }
func BenchmarkDoubleS2e5(b *testing.B) { var z big.Int for i := 0; i < b.N; i++ { double.DoubleFactorialS(&z, s, 2e5) } }