^

From WikiManual
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.