public member function
<valarray>
Return lowest value
Returns the minimum value contained in the valarray as if the elements were compared with
operator<.
Parameters
none
Return value
The lowest value in the valarray.
T is the template type of
valarray (the elements' type).
Example
1 2 3 4 5 6 7 8 9 10 11 12 13
|
// valarray::min example
#include <iostream>
#include <valarray>
using namespace std;
int main ()
{
int init[]={20,40,10,30};
valarray<int> myvalarray (init,4);
cout << "The min is " << myvalarray.min() << endl;
return 0;
}
|
Output:
See also
- valarray::sum
- Return sum of elements (public member function)
- valarray::max
- Return highest value (public member function)
- valarray operators
- Valarray operators (function)