Documentation
¶
Index ¶
- func Abs[T interface{ ... }](x T) T
- func BitwiseClear(a *int, x int)
- func BitwiseTo1(a *int, x int)
- func CountBit1(a int) uint8
- func Last1(a int) int
- func MaxN[T constraints.Ordered](vars ...T) T
- func MinN[T constraints.Ordered](vars ...T) T
- func PickBit(a int, x int) uint8
- func ReversionBit(a *uint16)
- func SameSign(a, b int) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T interface { constraints.Signed | constraints.Float }](x T) T
func CountBit1 ¶
使用 n&(n-1) 计算二进制1的个数, 可参考下图 
func MaxN ¶
func MaxN[T constraints.Ordered](vars ...T) T
func MinN ¶
func MinN[T constraints.Ordered](vars ...T) T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.