MCPcopy
hub / github.com/fogleman/primitive / clamp

Function clamp

primitive/util.go:130–138  ·  view source on GitHub ↗
(x, lo, hi float64)

Source from the content-addressed store, hash-verified

128}
129
130func clamp(x, lo, hi float64) float64 {
131 if x < lo {
132 return lo
133 }
134 if x > hi {
135 return hi
136 }
137 return x
138}
139
140func clampInt(x, lo, hi int) int {
141 if x < lo {

Callers 3

MutateMethod · 0.70
MutateMethod · 0.70
MutateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…