Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 200 Bytes

math.md

File metadata and controls

18 lines (13 loc) · 200 Bytes

数学

位运算

n & (n-1)

判断一个数是否是2的次幂

check := func(x int) bool {
  if x > 0 && x&(x-1) == 0 {
   return true
  }
  return false
}

排列组合