docs: add godoc comments to all exported functions and methods

This commit is contained in:
adman
2026-07-30 00:20:55 +02:00
parent 56c97a2b3f
commit 0d6b6e1ab9
50 changed files with 186 additions and 408 deletions
+2
View File
@@ -2,10 +2,12 @@ package util
import "math"
// FloorDiv returns floor division (rounds toward negative infinity).
func FloorDiv(a, b int32) int32 {
return (a - ((a%b + b) % b)) / b
}
// BpeByNum returns the minimum bits per element needed to represent x distinct values.
func BpeByNum(x float64) uint8 {
return uint8(math.Ceil(math.Log2(x)))
}