bounds

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
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

View Source
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")
)

Functions

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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