mathutil

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EPSILON float32 = 0.00000001

EPSILON very small

View Source
var EPSILON64 = 0.00000001

EPSILON64 very small

Functions

func Float64Equals

func Float64Equals(a, b float64) bool

Float64Equals float equal

func FloatEquals

func FloatEquals(a, b float32) bool

FloatEquals float equal

func Max

func Max(a, b int) int

Max max

func Min

func Min(a, b int) int

Min min

Types

type Limiter

type Limiter struct {
	Rate float64 // 每秒多少个
	// contains filtered or unexported fields
}

Limiter speed limiter

func NewLimiter

func NewLimiter(rate float64) *Limiter

NewLimiter create new limiter

func (*Limiter) Token

func (l *Limiter) Token() (c <-chan time.Time)

Token get token

Jump to

Keyboard shortcuts

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