extmath

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package extmath extend math

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs added in v0.1.6

func Abs(number int64) int64

Abs 整型取绝对值.

func Gcd

func Gcd(x, y int) int

Gcd get Greatest Common Divisor

func GcdSlice

func GcdSlice(n []int) int

GcdSlice get Greatest Common Divisor

func Gcdx

func Gcdx(x, y int) int

Gcdx get Greatest Common Divisor

func Lcm

func Lcm(x, y int) int

Lcm get least common multiple

func Pow added in v0.1.3

func Pow(x, y int64) int64

Pow is int64 type of math.Pow function.

func Range added in v0.1.6

func Range(start, end int) []int

Range 根据范围创建数组,包含指定的元素. start: 起始元素值 end: 末尾元素值 若start<end,返回升序的数组 若start>end,返回降序的数组.

func Round added in v0.1.4

func Round(f float64, n int) float64

Round 数值保留小数点,n为保留小数点位数

Types

This section is empty.

Jump to

Keyboard shortcuts

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