xmath

package
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ceil

func Ceil(f float64, n ...int) float64

Ceil 向上取整,并保留 n 位小数 @param f float64 待处理的浮点数 @param n ...int 可选的小数位数,默认保留 0 位小数 @return @1 float64 向上取整后的结果

func Floor

func Floor(f float64, n ...int) float64

Floor 向下取整,并保留 n 位小数 @param f float64 待处理的浮点数 @param n ...int 可选的小数位数,默认保留 0 位小数 @return @1 float64 向下取整后的结果

func Round

func Round(f float64, n ...int) float64

Round 四舍五入,并保留 n 位小数 采用“半数远离零”规则,例如 Round(-2.5) 返回 -3 @param f float64 待处理的浮点数 @param n ...int 可选的小数位数,默认保留 0 位小数 @return @1 float64 四舍五入后的结果

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL