Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
grahamsnns
Newbie


Joined: 06 May 2003
Posts: 3
Location: United Kingdom

PostPosted: Sat May 17, 2003 4:33 pm   

Bitxor/Bitand/bitor etc
 
Can someone be so kind as to show me how these commands work in relation to setting flag bits and checking to see if a variable has a certain flag set?

Thanks in advance.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon May 19, 2003 6:09 pm   
 
These involve binary numbers, where each digit is known as a bit.

%bitand applies the AND test to each bit of two numbers. If the bit is 1 in both numbers, it will be 1 in the result. Otherwise, it will be 0.

%bitor applies the OR test to each bit of two numbers. If the bit is 1 in either number, it will be 1 in the result. Otherwise, it will be 0.

%bitxor applies the XOR test to each bit of two numbers. If the bit is 1 in one number and 0 in the other, it will be 1 in the result. Otherwise, it will be 0.

%bitnot applies the NOT test to each bit of one number. If the bit is 1, it will be 0 in the result. Otherwise, it will be 1.

LightBulb
Advanced Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net