Bitwise comparation
#2

Valid bitwise character in pawn (you can add your own if you want)

Quote:
Originally Posted by pawn-lang.pdf
~e - results in the one's complement of e.
e1 >> e2 - results in the arithmetic shift to the right of e1 by e2 bits. The shift operation is signed: the leftmost bit of e1 is copied to vacant bits in the result.
e1 >>> e2 - results in the logical shift to the right of e1 by e2 bits. The shift operation is unsigned: the vacant bits of the result are filled with zeros.
e1 << e2 - results in the value of e1 shifted to the left by e2 bits; the rightmost bits are set to zero. There is no distinction between an arithmetic and a logical left shift
e1 & e2 - results in the bitwise logical "and" of e1 and e2.
e1 | e2 - results in the bitwise logical "or" of e1 and e2.
e1 ^ e2 - results in the bitwise "exclusive or" of e1 and e2.
and how to negate some statement

pawn Код:
(statement) == false
pawn Код:
!(statement)
Hope that helped in some way
Reply


Messages In This Thread
Bitwise comparation - by niCe - 31.10.2009, 18:52
Re: Bitwise comparation - by Nero_3D - 31.10.2009, 18:59
Re: Bitwise comparation - by niCe - 31.10.2009, 21:47
Re: Bitwise comparation - by Google63 - 31.10.2009, 21:50

Forum Jump:


Users browsing this thread: 2 Guest(s)