| 64 | } |
| 65 | |
| 66 | const double* largest(const double data[], size_t count) |
| 67 | { |
| 68 | if (!count) return nullptr; // There is no largest in an empty array |
| 69 | |
| 70 | size_t index_max {}; |
| 71 | for (size_t i {1}; i < count; ++i) |
| 72 | if (data[index_max] < data[i]) |
| 73 | index_max = i; |
| 74 | |
| 75 | return &data[index_max]; |
| 76 | } |
| 77 | |
| 78 | double* scale_range(double data[], size_t count, double divisor) |
| 79 | { |