Turn all overflow checking on.
Note that - 2^32 doesn't fit in a 32-bit integer type.
Ah yes, silly me, I've just noticed that my '
sum' variable is also declared as an '
Integer' which means it's limited to 32 bit. So this will need to be changed to an '
Int64' data type.
I'm not sure what you mean by
'Turn overflow checking on'. After a quick google, it's something to do with processor directives, I've only briefly read about these, so have no actual experience using them. Based on one example I'd looked at it seem like I just add
{$OVERFLOWCHECKS ON} at the top of my code. Please correct me if im wrong.