Results 1 to 2 of 2
table row values Forum: HTML ForumReplies: 1
Hashes lose values. Forum: CGI Perl ForumReplies: 0
04-13-2005, 07:38 AM #1
Getting min/max values from an array
If I have constructed an array in the following manner:
@myvalues = (1,2,3,4,5);
How do I find out what the lowest and highest numbers in the array are?
04-13-2005, 08:22 AM #2
Re: Getting min/max values from an array
Easiest I have found is to sort the array normally, grab the first element. Thats your highest. Then sort reverse, grab first, thats your lowest.
Theres some good examples here: http://www-cgi.cs.cmu.edu/Web/People/rgs/pl-exp-arr.htmlIf one of our members helps you, please click the icon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?