Documentation
¶
Index ¶
- func Abs(num int) int
- func AbsFloat(num float64) float64
- func Acos(value float64) float64
- func Asin(value float64) float64
- func Atan(value float64) float64
- func Average(nums ...int) float64
- func AverageFloat(nums ...float64) float64
- func Cbrt(num float64) float64
- func Ceil(num float64) int
- func Clamp(num, minValue, maxValue int) int
- func ClampFloat(num, minValue, maxValue float64) float64
- func Cos(angle float64) float64
- func DigitCount(num int) int
- func Factorial(num int) int
- func Fibonacci(n int) int
- func FibonacciSequence(n int) []int
- func Floor(num float64) int
- func FormatCurrency(num float64, symbol string) string
- func FormatNumber(num float64, precision int) string
- func FormatNumberWithCommas(num float64) string
- func FromBase(s string, base int) (int, error)
- func FromBinary(s string) (int, error)
- func FromHex(s string) (int, error)
- func FromOctal(s string) (int, error)
- func GCD(a, b int) int
- func IsEven(num int) bool
- func IsInteger(num float64) bool
- func IsNegative(num float64) bool
- func IsOdd(num int) bool
- func IsPerfectSquare(num int) bool
- func IsPositive(num float64) bool
- func IsPrime(num int) bool
- func IsZero(num float64) bool
- func LCM(a, b int) int
- func Max(nums ...int) int
- func MaxFloat(nums ...float64) float64
- func Min(nums ...int) int
- func MinFloat(nums ...float64) float64
- func Mod(a, b int) int
- func ModFloat(a, b float64) float64
- func Pow(base, exponent float64) float64
- func RandomFloat(minValue, maxValue float64) float64
- func RandomFloats(count int, minValue, maxValue float64) []float64
- func RandomInt(minValue, maxValue int) int
- func RandomInts(count, minValue, maxValue int) []int
- func ReverseNumber(num int) int
- func Round(num float64) int
- func RoundTo(num float64, precision int) float64
- func Sin(angle float64) float64
- func Sqrt(num float64) float64
- func Sum(nums ...int) int
- func SumFloat(nums ...float64) float64
- func SumOfDigits(num int) int
- func Tan(angle float64) float64
- func ToBase(num, base int) string
- func ToBinary(num int) string
- func ToFloat(v interface{}) (float64, error)
- func ToFloatDefault(v interface{}, defaultValue float64) float64
- func ToHex(num int) string
- func ToInt(v interface{}) (int, error)
- func ToIntDefault(v interface{}, defaultValue int) int
- func ToOctal(num int) string
- func ToString(v interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatNumberWithCommas ¶
FormatNumberWithCommas 格式化数字(添加千位分隔符)
func RandomFloat ¶
RandomFloat 生成指定范围内的随机浮点数 [minValue, maxValue)
func RandomFloats ¶
RandomFloats 生成指定数量的随机浮点数
func ToFloatDefault ¶
ToFloatDefault 转换为浮点数,失败返回默认值
func ToIntDefault ¶
ToIntDefault 转换为整数,失败返回默认值
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.