May 30, 2009 assert(0x814a & 0x8000 == 0x8000 ); Assertion failure | ||||
---|---|---|---|---|
| ||||
void main(){ assert(0x814a & 0x8000 == 0x8000 ); } |
May 30, 2009 Re: assert(0x814a & 0x8000 == 0x8000 ); Assertion failure | ||||
---|---|---|---|---|
| ||||
Posted in reply to test | test wrote:
> void main(){
> assert(0x814a & 0x8000 == 0x8000 );
> }
That's because it's equivalent to
void main(){
assert(0x814a & (0x8000 == 0x8000) );
}
the right side of the & is 'bool true', which is converted to 'int 1', which has none of the bits in 0x814a set...
You probably meant to do this:
void main(){
assert((0x814a & 0x8000) == 0x8000 );
}
|
Copyright © 1999-2021 by the D Language Foundation