Raised This Month: $ Target: $400
 0% 

[HELP] Switching two variables


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 12-27-2008 , 15:24   Re: [HELP] Switching two variables
Reply With Quote #1

Hey Daniel what's that operator ^= ? I never see it O.o
__________________
IneedHelp is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 12-27-2008 , 15:36   Re: [HELP] Switching two variables
Reply With Quote #2

Assignment XOR (exclusive disjunction).

http://en.wikipedia.org/wiki/XOR
http://en.wikipedia.org/wiki/XOR_swap_algorithm
__________________
No support via PM.

Last edited by Lee; 12-27-2008 at 15:48.
Lee is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 12-27-2008 , 19:37   Re: [HELP] Switching two variables
Reply With Quote #3

Quote:
Originally Posted by Lee View Post
That's simple stuff - I understood nearly 1% of it easily!
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-27-2008 , 22:09   Re: [HELP] Switching two variables
Reply With Quote #4

Quote:
Originally Posted by Dores View Post
That's simple stuff - I understood nearly 1% of it easily!
XOR = Toggle each bit if the correspondent bit of both the operands are different.

Example (number represented as bits)

111 XOR 111 = 000 (all bits equal)
000 XOR 111 = 111 (all bits different)
001 XOR 000 = 001 (only last bit different)
__________________

Community / No support through PM
danielkza is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode