// Max returns the greater of the provided values.
//
// The result is undefined if no values are are provided.
358551
func Max(x ...*decimal.Big) *decimal.Big {
	m := x[0]
	for _, v := range x[1:] {
		if v.Cmp(m) > 0 {
			m = v
		}
	}
	return m
}
1038705
func Minmax(data Interface) (min float64, min_index int, max float64, max_index int) {
	Len := data.Len()
	min = data.Get(0)
	max = data.Get(0)

	for i := 0; i < Len; i++ {
		xi := data.Get(i)

		if xi < min {
			min = xi
			min_index = i
		}

		if xi > max {
			max = xi
			max_index = i
		}

		if math.IsNaN(xi) {
			min = xi
			max = xi
			min_index = i
			max_index = i
			break
		}
	}

	return
}
610103
func (s *Statistics) Maximum() float64 {
	s.RLock()
	defer s.RUnlock()
	return s.maximum
}
276594
func (cp *Pool) MaxCap() int64 {
	p := cp.pool()
	if p == nil {
		return 0
	}
	return p.MaxCap()
}
941157
func (l *Limiter) GetMax() float64 {
	l.RLock()
	defer l.RUnlock()
	return l.max
}
1035897
func (u *Ugen) Max(other Input) Input {
	return binOpMax(u.Rate, u, other, u.NumOutputs)
}
1136478
func (c *Collection) Max() gtreap.Item {
	root := c.currentRoot()
	if root == nil {
		return nil
	}
	return root.Max()
}
1090146
func maxIndex(start, limit, total int) (max int) {
	if limit <= 0 {
		limit = mock.DefaultLimit
	}
	if limit > mock.MaxLimit {
		limit = mock.MaxLimit
	}
	max = total
	if start+limit < max {
		max = start + limit
	}
	return max
}
175176
func (r *Random) WithMax(max float64) *Random {
	r.max = &max
	return r
}
933883
func Max(a, b []float64) {
	b = b[:len(a)]

	for i, v := range a {
		bv := b[i]
		if bv > v {
			a[i] = bv
		}
	}
}
489325
func (nc *NumberConstraint) Maximum(n float64) *NumberConstraint {
	nc.applyMaximum = true
	nc.maximum = n
	return nc
}
638497
func (c C) Max(other Input) Input {
	if v, ok := other.(C); ok {
		return C(maxFloat32(float32(c), float32(v)))
	}
	return other.Max(c)
}
233724
func Max(v1, v2 Vect) (out Vect) {
	if v1.X > v2.X {
		out.X = v1.X
	} else {
		out.X = v2.X
	}

	if v1.Y > v2.Y {
		out.Y = v1.Y
	} else {
		out.Y = v2.Y
	}
	return
}
799780
func (s *SecureCookie) MaxAge(value int) *SecureCookie {
	s.maxAge = int64(value)
	return s
}
579738
func Max(input Float64Data) (max float64, err error) {

	// Return an error if there are no numbers
	if input.Len() == 0 {
		return math.NaN(), EmptyInputErr
	}

	// Get the first value as the starting point
	max = input.Get(0)

	// Loop and replace higher values
	for i := 1; i < input.Len(); i++ {
		if input.Get(i) > max {
			max = input.Get(i)
		}
	}

	return max, nil
}
1346593
func (a *AggregateResult) Max(field string, result interface{}) {
	a.Sort(field)

	resultVal := reflect.ValueOf(result)
	if resultVal.Kind() != reflect.Ptr {
		panic("result argument must be an address")
	}

	if resultVal.IsNil() {
		panic("result argument must not be nil")
	}

	resultVal.Elem().Set(a.reduction[len(a.reduction)-1].Elem())
}
1109147
func BigMax(x, y *big.Int) *big.Int {
	if x.Cmp(y) < 0 {
		return y
	}
	return x
}