MCPcopy Create free account
hub / github.com/cogentcore/core / Range

Function Range

plot/data.go:69–81  ·  view source on GitHub ↗

Range returns the minimum and maximum values.

(vs Valuer)

Source from the content-addressed store, hash-verified

67
68// Range returns the minimum and maximum values.
69func Range(vs Valuer) (min, max float32) {
70 min = math32.Inf(1)
71 max = math32.Inf(-1)
72 for i := 0; i < vs.Len(); i++ {
73 v := vs.Value(i)
74 if math32.IsNaN(v) {
75 continue
76 }
77 min = math32.Min(min, v)
78 max = math32.Max(max, v)
79 }
80 return
81}
82
83// Values implements the Valuer interface.
84type Values []float32

Callers 3

DataRangeMethod · 0.92
DataRangeMethod · 0.92
XYRangeFunction · 0.85

Calls 6

InfFunction · 0.92
IsNaNFunction · 0.92
MinFunction · 0.92
MaxFunction · 0.92
LenMethod · 0.65
ValueMethod · 0.65

Tested by

no test coverage detected