Bitwise operation doesn't work

A

Andrew Usher

Edward said:
This line should set to 0 one bit of an array (of 32-bit values):

P[[(c>>5)]]&=(!((0x00000001)<<(c2&0x0000001f)));

OK, first, why did you make it so unreadable? Is this part of some
obfuscated programming contest?

P[[c>>5]] &= !(1 << (c2 & 0x1f));

That's a little better.

I've gotten used to that style of inserting all possible parentheses
because I never learned the precedence of logical operators. Even so,
some of them should probably be removed.

Andrew Usher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top