Operators: <<= and >>=
#1

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.
Reply
#2

*= 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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)