piecefunc

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PercentUnit is used to define ratios with integers, it's 1.0
	PercentUnit = 1e6
)

Variables

This section is empty.

Functions

func Div

func Div(a, b uint64) uint64

Div is division of ratios with integer numbers

func Get

func Get(x uint64, pieces []Dot) uint64

Get calculates f(x), where f is a piecewise linear function defined by the pieces

func Mul

func Mul(a, b uint64) uint64

Mul is multiplication of ratios with integer numbers

Types

type Dot

type Dot struct {
	X uint64
	Y uint64
}

Dot is a pair of numbers

Jump to

Keyboard shortcuts

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