Programs
General

Comments
Constants
Exceptions
Execution Environments
Identifiers
Relaxations
Spacing
T-Tables
Text
Variables

Lines
Expressions
Types
Operators
Binary Arithmetic Operators
Boolean Operators
Conversion Operators
Relational Operators
Structural Operators
Unary Arithmetic Operators

Literals
Comments
Constants
Exceptions
Execution Environments
Identifiers
Relaxations
Spacing
T-Tables
Text
Variables

Lines
Expressions
Types
Operators
Binary Arithmetic Operators
Boolean Operators
Conversion Operators
Relational Operators
Structural Operators
Unary Arithmetic Operators

Literals
The following is the documentation for binary arithmetic operators. The binary arithmetic operators are of the form: `x = a <operator> b`

or `x = <operator name>(a, b)`

.

The documentation includes references to exceptions and relaxations.

For more information on exceptions, see exceptions.

For more information on relaxations, see relaxations.

All operations result in a decimal number type with 15 digits. The mathematics of this is covered in the section on the Decimal Number Type.

Syntax: `x = a + b`

Description: Sets x to the sum of a and b.

Exceptions:

- Overflow

Relaxations:

- Binary
- Exception

Syntax: `x = a - b`

Description: Sets x to the difference between a and b.

Exceptions:

- Overflow

Relaxations:

- Binary
- Exception

Syntax: `x = a * b`

Description: Sets x to the product of a and b.

Exceptions:

- Overflow

Relaxations:

- Binary
- Exception

Syntax: `x = a / b`

Description: Sets x to a divided by b.

Exceptions:

- Overflow
- Invalid operand, if b is zero.

Relaxations:

- Binary
- Exception

Syntax: `x = a ^ b`

Description: Sets x to a to the power of b.

Exceptions:

- Overflow
- Invalid operand
- If both a and b are zero.
- If a is negative and b is not a whole number.

Relaxations:

- Binary
- Exception

Syntax: `x = a mod b`

Description: Sets x to the reminder of a divided by b with integer division. The result is `0 <= x < b`

. Another way at looking at it is that `x = a - q*b`

, where q is the integer quotient when a is divided by b using integer division.

Exceptions:

- Invalid operand
- If a is negative.
- If b is zero.
- If b is negative.

Relaxations:

- Binary
- Exception

Syntax: `x = max(a, b)`

Description: x is set to the larger of a and b.

Syntax: `x = min(a, b)`

Description: x is set to the smaller of a and b.

We would be more than happy to help you. Our opening hours are 9–15 (CET).

📞 (+47) 93 68 22 77

Nils Bays vei 50, 0876 Oslo, Norway

Copyright © 2018-22 progsbase.com by Inductive AS.