You are viewing a single comment's thread. Return to all comments →
From http://stackoverflow.com/questions/8108642/type-of-integer-literals-not-int-by-default
"The type of an integer literal is the first of the corresponding list in Table 6 in which its value can be represented."
And Table 6, for literals without suffixes and decimal constants, gives:
int long int long long int
So, without the cast, the literal 0 can be represented as int, so accumulate uses int as the type for accumulation.
Seems like cookies are disabled on this browser, please enable them to open this website
A Very Big Sum
You are viewing a single comment's thread. Return to all comments →
From http://stackoverflow.com/questions/8108642/type-of-integer-literals-not-int-by-default
"The type of an integer literal is the first of the corresponding list in Table 6 in which its value can be represented."
And Table 6, for literals without suffixes and decimal constants, gives:
So, without the cast, the literal 0 can be represented as int, so accumulate uses int as the type for accumulation.