Finds the largest of an array of double values
| 27 | |
| 28 | // Finds the largest of an array of double values |
| 29 | double largest(const double data[], size_t count) |
| 30 | { |
| 31 | double max{ data[0] }; |
| 32 | for (size_t i{ 1 }; i < count; ++i) |
| 33 | if (max < data[i]) max = data[i]; |
| 34 | return max; |
| 35 | } |
| 36 | |
| 37 | // Finds the largest of a vector of double values |
| 38 | double largest(const std::vector<double>& data) |