Originally Posted by minder
That's a poor way to do it in general. The same logic for an initial value might come back to bite you in another situation. A better way is to set the initial highest value to the first data value and then check each subsequent data value to see if it is higher or lower to get the max. value of the dataset. When you get a higher value, set the highest value variable to the new highest value.
Rubbish, bullant! No temperture can be as low as -99999. In other situations I would use another (superior) method to get the min and max values of an array, not the beginner's method I suggest. You can only hope to improve!