MEL: Get Highest Values of an array (Code Snippet)

//================= Get Max Size of Array =====
proc float maxSize(float $array[]){
$size = size($array);
int $i;
float $temp = $array[0];
for($i = 1; $i < $size; $i++){
     if($temp < $array[$i]){
          $temp = $array[$i];       
        }       
}
return $temp;
}
 
//======= Usage =======
float $test = maxSize($array);

No Comments

Add Comment