In the following code :
#include<cstdio>
#define max(a,b) (a>b?a:b)
using namespace std;
int main()
{
int f=10000000;
long long i=(long long)max(1000000,f*f);
printf("%lld",i);
return 0;
}
I get the output of
276447232
But if I write
long long i=max((long long)1000000,(long long)f*f);
I get the output of
100000000000000
What is the difference between the two lines? Why doesn't the type conversion occur in the first case?