Azure Jane Lunatic (Azz) 🌺 (
azurelunatic) wrote2003-04-16 09:34 pm
lookups...
2's complement
bitwise and
bitwise or
open in C++
Demland's freaking that we haven't been taught all of this shit.
bitwise and
bitwise or
open in C++
Demland's freaking that we haven't been taught all of this shit.

no subject
Reverse all the numbers in the binary string. I.E. change all the 1's to 0's and change the 0's to 1. Do this for all the numbers except that last one. So the 2's compliment of 1111 would be 0001. 0000 would be 1110. 1010 would be 0100 etc.
bitwise and is like a multiplication. So if you have 1100 bitwise and with 0110 you would get 0100. For the first digits, 0 times 0 = 0. The second, 1 times 1 = 1. 1 times 0 = 0. The last, 0 times 0 = 0. So the only way to end up with a 1 is to have two 1's in the same value location.
bitwise and is somewhat the opposite. You need a 1 in either of the two spots to get a 1. So 1100 bitwise or with 0110 would give you 1110. 1 with 1 gives you 1. 1 with 1 gives you 1. 0 with 1 gives you 1. 0 and 0 gives you 0.
no subject
no subject
no subject
cRon didn't have us doing very much, if any, of that; he was more concerned with having us open our brains and get the idea of programming in there, whether one is writing in VB, Pascal, C, or whatever.
Demland and cRon will either get along excellently, or hate each other. Since both of them are reasonable and interesting men, I'm voting for get along.
Like I said to Kit, I have TFM; I should R it.
Well...
open() in C++ should be a lot like open() in C, shouldn't it? Do a man 2 open.
Re: Well...