package bounds

import "git.sr.ht/~seirdy/moac/v2/internal/bounds"

Package bounds holds/checks max/min acceptable values of user-provided inputs

Index

Package Files

bounds.go

Constants

const (
    // PlanckTemp is the Planck Temperature, the maximum temperature that today's physics can handle
    // Temperature values above this will result in an error.
    PlanckTemp = 1.417e32
)

Variables

var (
    // ErrImpossiblyHigh indicates that a value is higher than our current
    // understanding of physics allows or accounts for.
    ErrImpossiblyHigh = errors.New("value is physically impossibly large")
    // ErrImpossibleNegative indicates that a value that must be above zero was too low.
    ErrImpossibleNegative = errors.New("is below 0")
)

func NonNegative

func NonNegative(vs ...float64) error

NonNegative validates that all the given values are at or above 0.

func ValidateTemperature

func ValidateTemperature(temp float64) error

ValidateTemperature ensures that a given temperature is physically possible. Temperatures must be above zero and cannot surpass the Planck Temperature.

Version
v2.0.2 (latest)
Published
Oct 5, 2021
Platform
linux/amd64
Imports
2 packages (graph)
Last checked
2 weeks ago

Tools for package owners.