// Clamp returns f clamped to [low, high]
177376
func Clamp(f, low, high float32) float32 {
	return engomath.Clamp(f, low, high)
}
602572
func clamp(x int64) uint64 {
	if x < 0 {
		return 0
	}
	if x > math.MaxInt64 {
		return math.MaxUint64
	}
	return uint64(x)
}
649265
func (tr Row) ForceFloat(nn int) (val float64) {
	val, _ = tr.FloatErr(nn)
	return
}
349602
func (c *LRU) Cap() int {
	c.mu.RLock()
	defer c.mu.RUnlock()

	return c.cap
}
845272
func (as ArraySpec) DbAmp() Input {
	return as.proc(func(i Input) Input {
		return i.DbAmp()
	})
}
66509
func (u *Ugen) SoftClip() Input {
	return unaryOpSoftClip(u.Rate, u, u.NumOutputs)
}
385200
func (c *CMap) Range(fn func(val interface{})) {
	c.mutex.RLock()
	for _, item := range c.items {
		fn(item)
	}
	c.mutex.RUnlock()
}
180024
func (rc *rawConn) Control(fn func(fd uintptr)) error {
	return rc.opError(opRawControl, rc.rc.Control(fn))
}
1094174
func Linear(width int) ScaleFunc {
	return func(min, max, value float64) float64 {
		diff := max - min
		offset := value - min
		ratio := offset / diff
		return ratio * float64(width)
	}
}
515214
func clampInt(x, min, max int) int {
	if x < min {
		return min
	}
	if x > max {
		return max
	}
	return x
}
625530
func ClampFunc(low, high float64) func(float64) float64 {
	return func(a float64) float64 {
		return Clamp(a, low, high)
	}
}
474192
func (xs *xstats) Gauge(stat string, value float64, tags ...string) {
	if xs.s == nil {
		return
	}
	tags = append(tags, xs.tags...)
	xs.s.Gauge(xs.prefix+stat, value, tags...)
}
427257
func (l *Locking) Float32() (v float32) {
	l.Lock()
	v = l.R.Float32()
	l.Unlock()
	return
}
675525
func (u *Ugen) Thresh(val Input) Input {
	return binOpThresh(u.Rate, u, val, u.NumOutputs)
}
57826
func (s *Stack) Pop() (interface{}, error) {
	s.l.Lock()
	defer s.l.Unlock()
	l := len(s.s)
	if l > 0 {
		item := s.s[l-1]
		s.s = s.s[:l-1]
		return item, nil
	}
	return nil, ErrEmptyStack{action: "Pop"}
}
336645
func (h *nextRowHeap) Pop() interface{} {
	old := h.nextRowByInputs
	n := len(old)
	x := old[n-1]
	h.nextRowByInputs = old[0 : n-1]
	return x
}
651435
func (sb *StatsdBuffer) Gauge(stat string, value int64) error {
	sb.eventChannel <- &event.Gauge{Name: stat, Value: value}
	return nil
}