math_func

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilToPlaces

func CeilToPlaces(d decimal.Decimal, places int32) decimal.Decimal

CeilToPlaces 向上取整到指定小数位

func DecimalSqrt

func DecimalSqrt(value decimal.Decimal) decimal.Decimal

DecimalSqrt 使用牛顿-拉夫森法计算小数的平方根

func FastPow

func FastPow(base decimal.Decimal, exponent int64) decimal.Decimal

FastPow 使用位运算优化幂运算

func FloorToPlaces

func FloorToPlaces(d decimal.Decimal, places int32) decimal.Decimal

FloorToPlaces 向下取整到指定小数位

func OptimizedDecimalSqrt

func OptimizedDecimalSqrt(value decimal.Decimal) decimal.Decimal

OptimizedDecimalSqrt 优化的平方根计算

func RoundToPlaces

func RoundToPlaces(d decimal.Decimal, places int32) decimal.Decimal

RoundToPlaces 四舍五入到指定小数位

func TruncateToPlaces

func TruncateToPlaces(d decimal.Decimal, places int32) decimal.Decimal

TruncateToPlaces 截断到指定小数位(直接截断,不进行舍入)

Types

This section is empty.

Jump to

Keyboard shortcuts

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