mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-09-26 19:11:12 +08:00
11 lines
156 B
Go
11 lines
156 B
Go
package mathx
|
|
|
|
import (
|
|
"math"
|
|
)
|
|
|
|
// Floor 对float数据向下取整
|
|
func Floor[T float32 | float64](num T) int {
|
|
return int(math.Floor(float64(num)))
|
|
}
|