In reply to Have_A_Doubt:
Normally the result of the
sum() method is the same as the array’s elements, 32-bits. But when using the
with clause, the result is the size of expression inside.
(item == max) is a Boolean equality expression whose result is 1-bit, true or false. So you need the cast back to
int to get 32-bits.