Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse of the logical operator AND (&)

 a + b = c
 c - a = b

Ok, now

 a & b = c
 c ?? a = b

which operator replace "??" ?
Thanks

like image 993
Phiber Avatar asked Mar 26 '14 13:03

Phiber


1 Answers

There is no such operator, because it will be ill-defined if it exists:

so, let a = 0, c = 0

we have

a & 0 = c
a & 1 = c

then, we should have

c ?? a = 0   and  c ?? a = 1

, but an operator/function cannot return two values given the same input/parameters.

like image 91
thor Avatar answered Oct 22 '22 17:10

thor