piecefunc

package
v1.0.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DecimalUnit is used to define ratios with integers, it's 1.0
	DecimalUnit = 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, f Func) 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

type Func

type Func struct {
	// contains filtered or unexported fields
}

func NewFunc

func NewFunc(dots []Dot) Func

Jump to

Keyboard shortcuts

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