Friday 15 February 2019

Prolog: mod: Get the reminder


‘mod’ operator returns the remainder of the division operation.

1 ?- X is 10 mod 3.
X = 1.

2 ?- X is 10 mod 4.
X = 2.

3 ?- X is 10 mod 5.
X = 0.

4 ?- X is 10 mod 6.
X = 4.



Previous                                                 Next                                                 Home

No comments:

Post a Comment