num

package module
v0.0.0-...-1a563a3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp[T constraints.Ordered](n, min, max T) T

func Confidence

func Confidence(p float64, n int) float64

func ConfidenceScore

func ConfidenceScore(score, min, max float64, voteCount int) float64

func ConfidenceVote

func ConfidenceVote(upVotes, downVotes int) float64

func Gompertz

func Gompertz(t, a, b, c float64) float64

Gompertz function based on https://en.wikipedia.org/wiki/Gompertz_function

func Max

func Max[T constraints.Ordered](n ...T) (max T)

func Min

func Min[T constraints.Ordered](n ...T) (min T)

func Nudge

func Nudge(v, min, max, factor float64, seed int64) float64

Nudge adds random variance by a factor (0.0 for not variance, 1.0 for completely random) to the given value, also calmping it between min and max.

func Sum

func Sum[N Number](n ...N) (sum N)

Types

type Number

type Number interface {
	constraints.Integer | constraints.Float | constraints.Complex
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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