A Very Big Sum

  • + 1 comment

    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.