From the docs:
function bitor(p1 number, p2 number) return number is begin return p1-bitand(p1,p2)+p2; end; function bitxor(p1 number, p2 number) return number is begin return bitor(p1,p2)-bitand(p1,p2); end;
To see what these works, follow the logic with 0s and 1s for input, and then no, that there are no borrowings or caries.
- MarkusQ
Markusq
source share