SA-MP Forums Archive
Operators: <<= and >>= - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Operators: <<= and >>= (/showthread.php?tid=155042)



Operators: <<= and >>= - Vince - 16.06.2010

Hi

I was reading this page: https://sampwiki.blast.hk/wiki/Keywords:Initialisers when I came across some symbols that I haven't used yet:
Symbols like <<= and >>>= etc. What are they called, what do they do and what are they useful for?

Couldn't find anything about it.
I hope someone can explain it.


Re: Operators: <<= and >>= - (SF)Noobanatior - 16.06.2010

*= v *= e multiplies v with e
/= v /= e divides v by e.
%= v %= e assigns the remainder of the division of v by e to v.
>>= v >>= e shifts v arithmetically to the right by e bits.
>>>= v >>>= e shifts v logically to the right by e bits.
<<= v <<= e shifts v to the left by e bits.
&= v &= e applies a bitwise “and” to v and e and assigns the result to v.
|= v |= e applies a bitwise “or” to v and e and assigns the result to v.
^= v ^= e applies a bitwise “exclusive or” to v and e and assigns the result to v.