For example:
What happens here?
if(63 & 1) { ...... }
Edited by bigdilliams, 18 November 2012 - 08:10 AM.
We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 18 November 2012 - 08:01 AM
if(63 & 1) { ...... }
Edited by bigdilliams, 18 November 2012 - 08:10 AM.
Posted 18 November 2012 - 08:09 AM
Posted 18 November 2012 - 08:10 AM
Posted 18 November 2012 - 08:17 AM
A bitwise AND takes two binary representations of equal length and performs the logical AND operation on each pair of corresponding bits. The result in each position is 1 if the first bit is 1 and the second bit is 1; otherwise, the result is 0. In this, we perform the multiplication of two bits; i.e., 1 × 0 = 0 and 1 × 1 = 1
Edited by nife87, 18 November 2012 - 08:19 AM.
Posted 18 November 2012 - 08:18 AM
int Zahl = (54 & 63); std::cout << Zahl;63= 111111
Posted 18 November 2012 - 08:20 AM
Yes, but I made a small programm wich results in:
int Zahl = (54 & 63); std::cout << Zahl;63= 111111
54= 110110
so Zahl = 54
What is the sense behind that?
Edited by nife87, 18 November 2012 - 08:21 AM.
Posted 18 November 2012 - 08:25 AM
if(63 & 1) { ... }
Posted 18 November 2012 - 08:30 AM
P AND (&) Q | ||
---|---|---|
P | Q | P AND Q |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Edited by Radikalizm, 18 November 2012 - 08:32 AM.
I gets all your texture budgets!
Posted 18 November 2012 - 08:44 AM
What if I make this:
if(63 & 1) { ... }
When will the if-loop start?
Is the condition everytime true, and is it possible to be false with an other number?
Edited by kuramayoko10, 18 November 2012 - 08:46 AM.
Posted 18 November 2012 - 02:29 PM
What if I make this:
if(63 & 1) { ... }
When will the if-loop start?
Is the condition everytime true, and is it possible to be false with an other number?
if(63 & 1)is equal to
if(1)
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.