Predicate roundtoward/2 not available


I was exploring the arithmetic-predicate list, and I came across roundtoward/2. I tried running it but it wouldn’t.

?- roundtoward(1.24, to_nearest).
ERROR: Unknown procedure: roundtoward/2 (DWIM could not correct goal)

What does it do? I could not decipher the description in the documentation. I am running version 8.1.26.


It is used like

?- X is roundtoward(1.24, to_nearest).
X = 1.24.


1 Like

Thank you :slight_smile:

The trick is in this sentence in the docs: “Availability:Arithmetic function (see is/2)”. Unfortunately f/a is used to reference both predicates and functions in the Prolog community. Predicates, well you (probably) know. Functions are terms that can appear in the argument of (the predicates) is/2, =:=/2, >/2, etc.