digitalmars.D.bugs - constants and power
-
Manfred Nowak
(12/12)
Jan 24 2005
- Lukas Pinkowski (5/19) Jan 24 2005 "^" is the XOR-Operator not power. i.e.
- Manfred Nowak (5/6) Jan 24 2005 Arghhhh, severe black out on my side :-(
<code>
void main(){
const int num1 = 10^2;
const int num2 = 100^2;
const int num3 = 1000^3;
printf("%d %d %d\n", num1, num2, num3);
}
</code>
<output>
8 102 1003
</output>
-manfred
Jan 24 2005
Manfred Nowak wrote:
<code>
void main(){
const int num1 = 10^2;
const int num2 = 100^2;
const int num3 = 1000^3;
printf("%d %d %d\n", num1, num2, num3);
}
</code>
<output>
8 102 1003
</output>
-manfred
"^" is the XOR-Operator not power. i.e.
10 dec = 0b1010 in binary
0b1010 ^ 0b10 = 0b1000
0b1000 is 8 in decimal
Jan 24 2005
Lukas Pinkowski wrote: [...]"^" is the XOR-OperatorArghhhh, severe black out on my side :-( Thx. -manfred
Jan 24 2005








Manfred Nowak <svv1999 hotmail.com>