Documentation
¶
Overview ¶
Package mathutil provides small, dependency-free numeric helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Scaler ¶ added in v0.5.0
type Scaler interface {
// Scale maps value from [fromMin, fromMax] onto [toMin, toMax].
Scale(value, fromMin, fromMax, toMin, toMax int) int
}
Scaler rescales a numeric value from one range to another. It is the canonical example of an exported interface paired with a generated mock — the counterfeiter directive above this doc comment is intentionally placed above the doc block to exercise the reviewer's directive detection.
func ParseScalerDefault ¶ added in v0.5.0
ParseScalerDefault parses a scaler configuration, falling back to the provided default when the input is not a valid scaler description. The paired-default naming is mandated by the paired-parse-and-parsedefault rule and must not be flagged as a non-New constructor.
Click to show internal directories.
Click to hide internal directories.