User Tools

Site Tools


crpl:docs:xor

This is an old revision of the document!


<- CRPL reference <- Logical Operators

xor

ArgumentsResultNotation
Two items on the stackThe conditional XOR of the two arguments b1 b2 – b3

Description

Pops two items from the stack, treats them as boolean values, 'xors' (exclusive or) them, and pushes 0 or 1 back to the stack.

If both items are TRUE, 0 is pushed to the stack. If both items are FALSE, 0 is pushed to the stack. If one item is TRUE and the other is FALSE, 1 is pushed to the stack.

Examples

TRUE TRUE Trace     #prints out 0 (FALSE) to the tracelog
TRUE FALSE Trace    #prints out 1 (TRUE) to the tracelog
FALSE TRUE Trace    #prints out 1 (TRUE) to the tracelog
FALSE FALSE Trace   #prints out 0 (FALSE) to the tracelog
crpl/docs/xor.1612543437.txt.gz · Last modified: 2021/02/05 11:43 by Karsten75