0

What does '^' symbol stands for and how it works?

16th Jun 2018, 11:37 AM
Rajan Pandey
Rajan Pandey - avatar
3 Antworten
+ 1
Means Xor and is true if 1 operant is true and the other one is false and if both operants are true or false it ouputs false x=true y=false x^y = true works the same as if((x===true&&y===true)||(x===false&&y===false)){print("false")} else if((x===false&&y===true)||(x===true&&y===false){print("true")}
16th Jun 2018, 12:00 PM
Roel
Roel - avatar
+ 3
Like Maz say, its xor operator... Its called "exclusive or" and you can remember it with: It return true if operands are differents (one exclude other) else return false
16th Jun 2018, 12:23 PM
KrOW
KrOW - avatar
+ 1
its the xor operator. 0^0=0 1^1=0 0^1=1 1^0=1
16th Jun 2018, 11:57 AM
Max
Max - avatar