Raised This Month: $ Target: $400
 0% 

Bitwise Shift Operators


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
z-@T
New Member
Join Date: May 2010
Old 05-13-2010 , 03:07   Bitwise Shift Operators
Reply With Quote #1

Hey, guys, nice to meet you that's my first post here, but anyway let's go directly to the problem: Can someone please explain me a little more "simple" maybe, what those bitwise shift operators are used for?

When I read the pawn tutorial I saw what they do and an example, but I still can't understand what exacly are they and for what I could use them. I am asking for help about this, because I never thought I would need something like this but I seem to see them in use in almost every plugin I see.

Generally I ask for help because I see this almost everywhere and I don't understand it:

Code:
#define KEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
I can see it's for the menu...but as I said earlier...
z-@T is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-13-2010 , 03:09   Re: Bitwise Shift Operators
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=90507
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
z-@T
New Member
Join Date: May 2010
Old 05-13-2010 , 04:42   Re: Bitwise Shift Operators
Reply With Quote #3

Thanks alot.
z-@T is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2010 , 16:31   Re: Bitwise Shift Operators
Reply With Quote #4

Imo, that page is poorly written for ppl trying to learn. Bit operators are not unique to AMXX so you can search google or wiki for the operators for help if you do not understand that tut.
__________________
Bugsy is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-13-2010 , 16:37   Re: Bitwise Shift Operators
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Imo, that page is poorly written for ppl trying to learn. Bit operators are not unique to AMXX so you can search google or wiki for the operators for help if you do not understand that tut.
Agreed. When I read that page a few months back, it confused me more than it taught me anything. The way it's explained and the situation it's used in is very impractical and he should've used a different example.

EDIT: After reading it over again, it makes much more sense to me than previously, but this is mainly due to me learning the bitshifts through seeing them used in other plugins. It's still very confusing for beginners.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 05-13-2010 at 16:40.
wrecked_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2010 , 17:54   Re: Bitwise Shift Operators
Reply With Quote #6

I wrote a quite long and newb friendly bit tutorial that I never posted. I will prob touch it up a bit and post it as maybe a beginners bit tut.
__________________
Bugsy 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 03:56.


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