zfloat

package
v0.0.0-...-9e2b535 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 6 Imported by: 5

Documentation

Index

Constants

View Source
const Undefined = math.MaxFloat32

Variables

This section is empty.

Functions

func AddToSet

func AddToSet(slice *[]float64, n float64) bool

func Average

func Average(f []float64) float64

func Clamped

func Clamped(v, min, max float64) float64

func Clamped32

func Clamped32(v, min, max float32) float32

func GetAny

func GetAny(i any) (float64, error)

func IsInSlice

func IsInSlice(n float64, slice []float64) bool

func Join64

func Join64(ids []int64, sep string) string

func KeepFractionDigits

func KeepFractionDigits(f float64, digits int) float64

func Max32

func Max32(a, b float32) float32

func MaxKeyOfMap

func MaxKeyOfMap(m map[string]float64) (key string, value float64)

func Maximize

func Maximize(a *float64, b float64) bool

func Maximize32

func Maximize32(a *float32, b float32) bool

func Min32

func Min32(a, b float32) float32

func Minimize

func Minimize(a *float64, b float64) bool

func Minimize32

func Minimize32(a *float32, b float32) bool

func MixedValueAtIndex

func MixedValueAtIndex(slice []float64, index float64) float64

MixedValueAtIndex returns a mix of the value before and after index; So if index is 4.25, it will return a mix of 75% [4] and 25% [5]

func MixedValueAtT

func MixedValueAtT(slice []float64, t float64) float64

MixedValueAtT returns the mix beween the values t lies within using MixedValueAtIndex t is 0-1, corresponding to 0 as 100% of [0] and 1 as 100% the last slice element.

func SetAny

func SetAny(num any, f float64) error

func SplitStringTo64

func SplitStringTo64(str string, sep string) []float64

func StringsTo64

func StringsTo64(snums []string) []float64

func Sum

func Sum(all []float64) float64

func ToStrings64

func ToStrings64(floats []float64) (s []string)

Types

type Slice

type Slice []float64

func (Slice) Count

func (s Slice) Count() int

func (Slice) GetItem

func (s Slice) GetItem(i int) (id, name string, value any)

GetItem makes Slice worth with MenuView MenuItems interface

func (Slice) Minimum

func (s Slice) Minimum() float64

Jump to

Keyboard shortcuts

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