3
votes

In C, given two numbers like this:

1010
0101

I can do something like this:

0000 == 1010&&0101;
1111 == 1010||0101;

Then is it possible to use Prolog do the same thing..?

Thank you!

1
Look here: en.wikibooks.org/wiki/Prolog/… ... (Bitwise AND, Bitwise OR predicates). - Robert Harvey
@RobertHarvey This is very helpful! - lllllllllllll

1 Answers

5
votes

In prolog, you can use the following operators for bitwise arithmatic

&& = /\ 
|| = \/

I hope this helps.