Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cbrt ¶
Cbrt returns the integer cube root of n. That is to say, the r such that:
r * r * r <= n && n < (r + 1) * (r + 1) * (r + 1)
Adapted from code found in Hacker's Delight, fixed by Fabian Giessen https://gist.github.com/729557
func Log2 ¶
Log2 returns log base 2 of n. It's the same as index of the highest bit set in n. n == 0 returns 0
func Sqrt ¶
Sqrt returns the square root of x. Based on code found in Hacker's Delight (Addison-Wesley, 2003): http://www.hackersdelight.org/
func TrailingZeros ¶
TrailingZeros returns the number of trailing 0 bits in v. If v is 0, it returns 0.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.