RandInt generates numbers between 0 and 2billion. This is a rare range of values in a typical PLC system.
We utilize 32 bit integer math all the time in Do-more Designer's C++ code. We rarely use double or float or 64 bit integers (but sometimes they are needed when calculation range exceeds 2 billion).
If you have 31 values, if they are mostly in the range 0..1,000,000, adding them up gets you 31,000,000 - nowhere close to the "overflow" integer range of 2,147,483,647. Not sure what you measure in a PLC that equals 1,000,000, but that is rare. Hence, you can/should use integer arithmetic for most of your summing calculations.
HOWEVER, you do need to be aware of this limitation, because sometimes you ARE summing up or doing integer math on large values (long time values in milliseconds, large raw encoder values, et. al.), then you do need to convert to REAL. Also, if you are adding up 10,000 values all around 1,000,000 then you WILL exceed 2billion.
Note that REALs are also limited to 32 bits, but they provide wider range of values, but sometimes with less accuracy than integers. You have 24 bits of significant digits in a REAL, which is around 7 significant digits in decimal. So you can have approximate numbers like 1,234,567,000,000,000,000,000 or like 0.0000000000000001234567, but you cannot differentiate between numbers like 2,147,483,647 and 2,147,483,646 (nearly 10 significant digits) which you can have in a 32 bit integer.
Just ball park your guestimate of the calculation. If it gets close or over 2billion, you probably need to consider using REAL. If it stays below that (e.g. 31 values worst-case being around 1 million), you can stick with 32 bit integer to get the speed and accuracy of integer math.