在这种情况下我们需要演员吗?:
#include <stdio.h>
#include <stdint.h>
int main(){
// Say we're working with 32-bit variables.
uint32_t a = 123456789;
uint32_t b = 5123412;
uint32_t c = 123049811;
// We want to use 64-bit arithmetic at some intermediate stage,
// e.g. the a*b product here. After dividing by 'c', the result
// again fits into a 32-bit unsigned, 'result'.
uint32_t result = (uint64_t)a*b/c;
// QUESTION HERE: Should we cast before the assignment? I.e.:
//uint32_t result = (uint32_t)( (uint64_t)a*b/c );
// Either way the result turns out OK on my system.
printf("%u\n", (unsigned)result);
}