# Maximum and Minimum values¶

gsl_stats_max(data)

This function returns the maximum value in data. The maximum value is defined as the value of the element $$x_i$$ which satisfies $$x_i \ge x_j$$ for all $$j$$.

If you want instead to find the element with the largest absolute magnitude you will need to apply fabs() or abs() to your data before calling this function.

gsl_stats_min(data)

This function returns the minimum value in data. The minimum value is defined as the value of the element $$x_i$$ which satisfies $$x_i \le x_j$$ for all $$j$$.

If you want instead to find the element with the smallest absolute magnitude you will need to apply fabs() or abs() to your data before calling this function.

gsl_stats_max_index(data)

This function returns the index of the maximum value in data. The maximum value is defined as the value of the element $$x_i$$ which satisfies $$x_i \ge x_j$$ for all $$j$$. When there are several equal maximum elements then the first one is chosen.

gsl_stats_min_index(data)

This function returns the index of the minimum value in data. The minimum value is defined as the value of the element $$x_i$$ which satisfies

$$x_i \le x_j$$

for all $$j$$. When there are several equal maximum elements then the first one is chosen.