﻿ ARITHMETIC FUNCTIONS REFERENCE
TYL PROGRAMMING LANGUAGE
▶ ARITHMETIC FUNCTIONS REFERENCE
Arithmetic function, is a function that has two parameters (operands) left, right. It does an arithmetic or boolean calculation, and returns the result.

Arithmetic function format:
left OP right → result
`left`
Left operand, scalar variable
`right`
Right operand, Tyl statement that its result is scalar variable

`OP`
An operator of arithmetic or logic type
`result`
An arithmetic or boolean operation

If `a` and `b` are the operands, than a plus operation will look like:
a + b
There are also double operators, for ex. '++', that causes the left operand to get the result of the operation. Meaning, `left` will be modified.

Arithmetic function format (double operator):
left [OP][OP] right → result
If `a` and `b` are the operands, than a double plus operation will look like:
a ++ b
In cases where `left` and `right` can't yield result from an operation, the result will be `left`.
Attention: Arithmetic operators are also used in string concatanations and composite numeric calculations, and their operative result can be different from the dual operation result described here!

All arithmetic functions are described in the following tables:
+ operator
Operands
Result
numbers
sum of numbers
strings
concatenated strings
string and non string
concatenated string representation of operands
booleans
`left` OR `right`
++ operator
Operands
Result
left number only
`left` is incremented by 1
numbers
sum of numbers
strings
concatenated strings
string and non string
concatenated string representation of operands
booleans
`left` OR `right`
- operator
Operands
Result
numbers
subtraction of numbers
booleans
`left` OR NOT `right`
-- operator
Operands
Result
left number only
`left` is decremented by 1
numbers
subtraction of numbers
booleans
`left` OR NOT `right`
* operator
Operands
Result
numbers
multiplication of numbers
booleans
`left` AND `right`
** operator
Operands
Result
numbers
multiplication of numbers
booleans
`left` AND `right`
/ operator
Operands
Result
numbers
if `right` is not zero - division of numbers, otherwise raises an error
booleans
`left` AND NOT `right`
// operator
Operands
Result
numbers
if `right` is not zero - division of numbers, otherwise raises an error
booleans
`left` AND NOT `right`