Pelles C forum
Pelles C => General discussions => Topic started by: czerny on July 06, 2014, 04:03:19 PM
-
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
-
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
-
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!