Documentation ¶
Index ¶
- Constants
- type F32
- func (mr *F32) ClipNormVal(val float32) float32
- func (mr *F32) ClipVal(val float32) float32
- func (mr *F32) FitInRange(oth F32) bool
- func (mr *F32) FitValInRange(val float32) bool
- func (mr *F32) InRange(val float32) bool
- func (mr *F32) IsHigh(val float32) bool
- func (mr *F32) IsLow(val float32) bool
- func (mr *F32) IsValid() bool
- func (mr *F32) Midpoint() float32
- func (mr *F32) NormVal(val float32) float32
- func (mr *F32) ProjVal(val float32) float32
- func (mr *F32) Range() float32
- func (mr *F32) Scale() float32
- func (mr *F32) Set(min, max float32)
- func (mr *F32) SetInfinity()
Constants ¶
const ( MaxFloat32 float32 = 3.402823466e+38 MinFloat32 float32 = 1.175494351e-38 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type F32 ¶
F32 represents a min / max range for float32 values. Supports clipping, renormalizing, etc
func (*F32) ClipNormVal ¶
ClipNormVal clips then normalizes given value within 0-1 Note: a NaN will remain as a NaN
func (*F32) ClipVal ¶
ClipVal clips given value within Min / Max range Note: a NaN will remain as a NaN
func (*F32) FitInRange ¶
FitInRange adjusts our Min, Max to fit within those of other F32 returns true if we had to adjust to fit.
func (*F32) FitValInRange ¶
FitValInRange adjusts our Min, Max to fit given value within Min, Max range returns true if we had to adjust to fit.
func (*F32) NormVal ¶
NormVal normalizes value to 0-1 unit range relative to current Min / Max range Clips the value within Min-Max range first.
func (*F32) ProjVal ¶
ProjVal projects a 0-1 normalized unit value into current Min / Max range (inverse of NormVal)
func (*F32) SetInfinity ¶
func (mr *F32) SetInfinity()
SetInfinity sets the Min to +MaxFloat, Max to -MaxFloat -- suitable for iteratively calling Fit*InRange