Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
keegancsmith committed May 13, 2024
1 parent 66ac4b9 commit 0fc3a9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/rockskip/server.go
Expand Up @@ -267,5 +267,8 @@ func ruler(n int) int {
if n <= 0 {
return 0
}
// ruler(n) is equivalent to asking how many times can you divide n by 2
// before you get an odd number. That is the number of 0's at the end of n
// when n is written in base 2.
return bits.TrailingZeros(uint(n))
}

0 comments on commit 0fc3a9d

Please sign in to comment.