[behdad@home ~]$ cat a.c
#include
#define OVERFLOWS(x) ((long long)(x) != ((long long) x))
int
main (void)
{
printf ("4*1073741828 overflows? %d\n", OVERFLOWS (4*1073741828));
printf ("1073741828*4 overflows? %d\n", OVERFLOWS (1073741828*4));
printf ("4*107741828 overflows? %d\n", OVERFLOWS (107741828*4 ));
return 0;
}
[behdad@home ~]$ ./a
4*1073741828 overflows? 1
1073741828*4 overflows? 1
4*107741828 overflows? 0