Re: bitvector question

From: Rob Baumstark (shirak@CONNECT.AB.CA)
Date: 04/29/98


>thus  A = 0110
>      B = 1100
>
>      C = 1000 - this would be the effect (C has what B does but not
A..ugh)
>
>I think what Rob Baumstark said would work...
>     C = B-(A^B)
>
>Gunna have to try that
Thats not quite what you want, you need C=B-(A&B) line
 that would come out to 1100 - (0100) = 1000 (You can do the & in your head)

If you did B-(A^B) you would get 1100 - (1010) = 0010 (Do the ^ in your
head, I needed a hex-calculator to do the subtraction here though)

If you are using Windows, start up the calculator from accessories, put it
in scientific mode, and it will do binary for you, you can play around till
you get what you want.  If you are using Unix, well someone else will
probably reply saying where a binary calculator is in it.  it probably has
one, but if it does I don't know where it is.
------------------------------------------------------------
G:  "If we do happen to step on a mine, Sir, what do we do?"
EB: "Normal procedure, Lieutenant, is to jump 200 feet in
     the air and scatter oneself over a wide area."
-- Somewhere in No Man's Land, BA4
------------------------------------------------------------
     Rob Baumstark:   shirak@connect.ab.ca
                      cst0656@nait.ab.ca
------------------------------------------------------------


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST