support multi-module (#4)

* add multimodule
* re-package modules
This commit is contained in:
Ilia Denisov
2026-02-22 08:57:19 +02:00
committed by GitHub
parent 9e36d7151e
commit 8f982278d2
132 changed files with 317 additions and 191 deletions
+22
View File
@@ -0,0 +1,22 @@
package util
import (
"math"
)
func Fixed3(num float64) float64 {
return fixed(num, 3)
}
func Fixed12(num float64) float64 {
return fixed(num, 12)
}
func fixed(num float64, precision int) float64 {
output := math.Pow(10, float64(precision))
return float64(round(num*output)) / output
}
func round(num float64) int {
return int(num + math.Copysign(0.5, num))
}