Real operators (The GNU Algol 68 Compiler)

### 6.7 Real operators ¶

#### 6.7.1 Arithmetic ¶

Operator: + `= (l real a) l real` ¶

  Monadic operator that yields the affirmation of its operand.

Operator: - `= (l real a) l real` ¶

  Monadic operator that yields the negative of its operand.

Operator: abs `= (l real a) l real` ¶

  Monadic operator that yields the absolute value of its operand.

Operator: sign `= (l real a) int` ¶

  Monadic operator that yields -1 if `a` if negative, 0 if `a` is zero and 1 if `a` is positive.

Operator: + `= (l real a, b) l real` ¶

  Dyadic operator that yields the addition of its operands.

Operator: - `= (l real a, b) l real` ¶

  Dyadic operator that yields `b` subtracted from `a`.

Operator: * `= (l real a, b) l real` ¶

  Dyadic operator that yields the multiplication of its operands.

Operator: / `= (l real a, b) l real` ¶

  Dyadic operator that yields the realeger division with real result of `a` by `b`.

Operator: ** `= (l real a, b) l real` ¶
Operator: ^ `= (l real a, b) l real` ¶

  Dyadic operator that yields `a` raised to the real exponent `b`.

Operator: ** `= (l real a, int b) l real` ¶
Operator: ^ `= (l real a, int b) l real` ¶

  Dyadic operator that yields `a` raised to the integral exponent `b`.

#### 6.7.2 Arithmetic combined with assignation ¶

Operator: plusab `= (ref l real a, l real b) ref l real` ¶
Operator: +:= `= (ref l real a, l real b) ref l real` ¶

  Plus and become. Dyadic operator that calculates `a + b`, assigns the result of the operation to the name `a` and then yields `a`.

Operator: minusab `= (ref l real a, l real b) ref l real` ¶
Operator: -:= `= (ref l real a, l real b) ref l real` ¶

  Dyadic operator that calculates `a - b`, assigns the result of the operation to the name `a` and then yields `a`.

Operator: timesab `= (ref l real a, l real b) ref l real` ¶
Operator: *:= `= (ref l real a, l real b) ref l real` ¶

  Dyadic operator that calculates `a * b`, assigns the result of the operation to the name `a` and then yields `a`.

Operator: divab `= (ref l real a, l real b) ref l real` ¶
Operator: /:= `= (ref l real a, l real b) ref l real` ¶

  Dyadic operator that calculates `a / b`, assigns the result of the operation to the name `a` and then yields `a`.

#### 6.7.3 Relational ¶

Operator: eq `= (l real a, b) bool` ¶
Operator: = `= (l real a, b) bool` ¶

  Dyadic operator that yields whether its operands are equal.

Operator: ne `= (l real a, b) bool` ¶
Operator: /= `= (l real a, b) bool` ¶

  Dyadic operator that yields whether its operands are not equal.

Operator: lt `= (l real a, b) bool` ¶
Operator: < `= (l real a, b) bool` ¶

  Dyadic operator that yields whether `a` is less than `b`.

Operator: le `= (l real a, b) bool` ¶
Operator: <= `= (l real a, b) bool` ¶

  Dyadic operator that yields whether `a` is less than, or equal to `b`.

Operator: gt `= (l real a, b) bool` ¶
Operator: > `= (l real a, b) bool` ¶

  Dyadic operator that yields whether `a` is greater than `b`.

Operator: ge `= (l real a, b) bool` ¶
Operator: >= `= (l real a, b) bool` ¶

  Dyadic operator that yields whether `a` is greater than, or equal to `b`.

#### 6.7.4 Conversions ¶

Operator: round `= (l real a) int` ¶

  Monadic operator that yields the nearest integer to its operand.

Operator: entier `= (l real a) l int` ¶

  Monadic operator that yields the integer equal to `a`, or the next integer below (more negative than) `a`.

  Selecting the `gnu68` dialect provides the floor operator as a synonym for entier. See Extended real operators.

Operator: shorten `= (long real a) real` ¶
Operator: shorten `= (long long real a) long real` ¶

  Monadic operator that yields, if it exists, the real value that can be lengthened to the value of `a`. If the value doesn’t exist then the operator yields either the most positive real value in the destination mode, if `a` is bigger than that value, or the most negative real value in the destination mode, if `a` is smaller than that value.

Operator: leng `= (real a) long real` ¶
Operator: leng `= (long real a) long long real` ¶

  Monadic operator that yields the real value lengthened from the value of `a`.