Apart from the brute force method of course....
public double getMax() {
double maxValue = buffer[0];
for (int i = 1; i < buffer.length; i++){
if (buffer[i] > maxValue){
maxValue = buffer[i];
}
}
return maxValue;
}
public double getMin() {
double minValue = buffer[0];
for (int i = 1; i < buffer.length; i++){
if (buffer[i] < minValue){
minValue = buffer[i];
}
}
return minValue;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"JBookTrader" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jbooktrader?hl=en
-~----------~----~----~----~------~----~------~--~---