^

From WikiManual
Revision as of 11:43, 11 August 2007 by MacadamiaNuts (talk | contribs) (New page: Picks two numbers in the stack and returns the XOR comparison of their bits. 0 0 ^ = 0 1 0 ^ = 1 1 1 ^ = 0 -1 0 ^ = -1 -1 -1 ^ = 0 It always returns zero when both number...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Picks two numbers in the stack and returns the XOR comparison of their bits.

 0  0 ^ =  0
 1  0 ^ =  1
 1  1 ^ =  0
-1  0 ^ = -1
-1 -1 ^ =  0

It always returns zero when both numbers are equal.

It always returns a negative number when both numbers are different and one number is negative.

It always returns a positive number when both numbers are different and positive.

Possible uses

-1 .shoot *.refeye *.myeye ^ sgn abs mult store

Will shoot at anything with different amount of eyes.