printf("%u\n", 2^31);
Why is the compiler not complaining about this?
I don't think the compiler is checking.
printf("%d\n", 2^44);
However, it does with this.
unsigned long long ll = 9;
printf("%d\n", ll);
John
Have you seen the output?
#define m1 2^32
printf("m1 : %u\n", m1); // 34
#define m2 2^31
printf("m2 : %u\n", m2); // 29
printf("m3 : %u\n", 2^44); // 46
I have. One assumes that without an actual type it is not checked.
And it appears that ^ is not doing the right thing.
John
It really is a sad sight to see two people who've presumably been using C for years not know that ^ is XOR.
pow is in math.h
Quote from: aardvajk on July 06, 2014, 06:51:16 PM
It really is a sad sight to see two people who've presumably been using C for years not know that ^ is XOR.
pow is in math.h
You're right!
John
Quote from: JohnF on July 06, 2014, 07:42:10 PM
Quote from: aardvajk on July 06, 2014, 06:51:16 PM
It really is a sad sight to see two people who've presumably been using C for years not know that ^ is XOR.
pow is in math.h
You're right!
John
Hihi, thats funny! Everyone is a beginner, somehow!
Hey aardvajk, don't feel sad, laugh with us!