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

Function TestIsPowOfTwoUseLog

math/checkisnumberpoweroftwo_test.go:37–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestIsPowOfTwoUseLog(t *testing.T) {
38 tests := getTestsForPowerOfTwo()
39 for _, tv := range tests {
40 t.Run(tv.name, func(t *testing.T) {
41 result := IsPowOfTwoUseLog(float64(tv.a))
42 t.Log(tv.a, " ", result)
43 if result != tv.missing {
44 t.Errorf("Wrong result! Expected:%v, returned:%v ", tv.missing, result)
45 }
46 })
47 }
48}
49
50func BenchmarkIsPowerOfTwoUseLog(b *testing.B) {
51 for i := 0; i < b.N; i++ {

Callers

nothing calls this directly

Calls 2

IsPowOfTwoUseLogFunction · 0.85
getTestsForPowerOfTwoFunction · 0.70

Tested by

no test coverage detected