# Predicate roundtoward/2 not available

**URL:** <https://swi-prolog.discourse.group/t/predicate-roundtoward-2-not-available/2057>\
**Category:** Predicate\
**Created:** [March 23, 2020, 10:58pm UTC](https://swi-prolog.discourse.group/t/predicate-roundtoward-2-not-available/2057 "2020-03-23T22:58:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aminemarref](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@aminemarref](https://swi-prolog.discourse.group/u/aminemarref)\
**Post date:** [March 23, 2020, 10:58pm UTC](https://swi-prolog.discourse.group/t/predicate-roundtoward-2-not-available/2057/1 "2020-03-23T22:58:33Z")

</div>

Hello,

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.

Thanks.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [March 23, 2020, 11:03pm UTC](https://swi-prolog.discourse.group/t/predicate-roundtoward-2-not-available/2057/2 "2020-03-23T23:03:35Z")

</div>

It is used like

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

```

HTH

---

<div class="post-metadata">

**Author:** ![aminemarref](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@aminemarref](https://swi-prolog.discourse.group/u/aminemarref)\
**Post date:** [March 23, 2020, 11:04pm UTC](https://swi-prolog.discourse.group/t/predicate-roundtoward-2-not-available/2057/3 "2020-03-23T23:04:46Z")

</div>

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 24, 2020, 8:13am UTC](https://swi-prolog.discourse.group/t/predicate-roundtoward-2-not-available/2057/4 "2020-03-24T08:13:45Z")

</div>

> [@aminemarref](#):
>
> I could not decipher the description in the documentation

The trick is in this sentence in the docs: _“Availability:Arithmetic function (see [is/2](https://www.swi-prolog.org/pldoc/doc_for?object=(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.
