[Contents] ·
[Home] ·
[Mail]

## SALIERI Language - Operator "div" (_DIV)

** Type:**

_DIV: integer x integer -> integer

** Call syntax:**

_DIV(*x*,
*y*)

*x* div
*y*

** Description:**

The binary infix operator "div" realises arithmetic
division on integers;
there is a corresponding
predefined function *_DIV*, such that
*a div b* and
*_DIV(a,b)* are equivalent expressions.

"div" on negative arguments is defined such that the
following equalities hold:

*x div -y = -x div y*

*-x div -y = x div y*

In expressions, "div" binds stronger than "+" and "-",
but weeker than list element access (@) and
the length operator (#).

The operator "div" is used to compute integer division
remainders while "/" realises real division.

** Example:**

> 13 div 5

*Result= 2*

> 13 div -5

*Result= -2*

> -13 div 5

*Result= -2*

> -13 div -5

*Result= 2*

** See also:**
Operator "/",
Operator "mod",
Operators and Expressions.

[Contents] ·
[Home] ·
[Mail]

*© sic!systems, page frame designed by
hh;
this page has been automatically generated from the SALIERI
Documentation Database.
*