MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestRecursivePower1

Function TestRecursivePower1

math/power/fastexponent_test.go:40–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestRecursivePower1(t *testing.T) {
41 for _, tc := range testCases {
42 t.Run(tc.name, func(t *testing.T) {
43 actual := RecursivePower1(tc.base, tc.power)
44 if actual != tc.expected {
45 t.Errorf("Expected %d to the power of %d to be: %d, but got: %d", tc.base, tc.power, tc.expected, actual)
46 }
47 })
48 }
49}
50
51func BenchmarkIterativePower(b *testing.B) {
52 for i := 0; i < b.N; i++ {

Callers

nothing calls this directly

Calls 1

RecursivePower1Function · 0.85

Tested by

no test coverage detected