fred22
10-05-2005, 12:54 AM
Anybody got any great ideas on how to find the smallest and biggest number in an array?
maybe...something like this....
float $array[] = {1,2,3};
float $min;
float $min2;
for($i=0; $i>size($array);$i++)
{
for($j=0; $j>size($array);$j++)
{
$min = `min $array[$i] $array[$j]`;
}
}
print $min;
print "\n";
Though I have the problem of reassigning the $min value with next comparasion minium value.
Thanks
maybe...something like this....
float $array[] = {1,2,3};
float $min;
float $min2;
for($i=0; $i>size($array);$i++)
{
for($j=0; $j>size($array);$j++)
{
$min = `min $array[$i] $array[$j]`;
}
}
print $min;
print "\n";
Though I have the problem of reassigning the $min value with next comparasion minium value.
Thanks
