Answered by:
Maximum of a list of numbers
Question

Answers

The easiest would be to loop through an array of the numbers, and check if each is larger than your current max, then if it is update the current maximum.
Here is some pseudocode (the logic of the code in words)
set the current max to a small number
loop through each number
if the current number is larger than current max then set the current max to this number
loop on the next number in the list
the current max will be the largest number in the list
Have a go and post any problems with the code you are using.
 Marked as answer by Luquitas94 Saturday, September 3, 2011 10:57 AM

ok thanks that's what i thought but what i was really asking was if there was a builtin tool... thanks anyway XD
FVN009
 Marked as answer by Luquitas94 Saturday, September 3, 2011 10:57 AM
All replies

The easiest would be to loop through an array of the numbers, and check if each is larger than your current max, then if it is update the current maximum.
Here is some pseudocode (the logic of the code in words)
set the current max to a small number
loop through each number
if the current number is larger than current max then set the current max to this number
loop on the next number in the list
the current max will be the largest number in the list
Have a go and post any problems with the code you are using.
 Marked as answer by Luquitas94 Saturday, September 3, 2011 10:57 AM

ok thanks that's what i thought but what i was really asking was if there was a builtin tool... thanks anyway XD
FVN009
 Marked as answer by Luquitas94 Saturday, September 3, 2011 10:57 AM