Operators: /

Division operator.

Syntax

integer‑operand/integer‑operand

float‑operand/float‑operand

Integer division

In its first version, the / operator divides the left integer operand by the right integer operand. If used with two signed integer operands, the resulting data type is always int32. In all other cases, the operation results in the unsigned uint32 value. Please note, trying to perform the division with the right operand == 0 (zero) will raise a 'division by zero' runtime CPU exception. For example:

var int32 a = 2500; var int32 b = -7; var uint32 c = 1098; var uint32 d = 57; var int32 result = a / b; // result = -357 var uint32 result = c / d; // result = 19 var uint32 result = b / d; // result = 75350303 (overflow)

Floating point division

In its second version, the / operator divides the left floating-point operand by the right floating-point operand. The resulting data type of the operation is always a float. Please note, trying to perform the division with the right operand == 0.0 (zero) will raise a 'division by zero' runtime CPU exception. For example:

var float a = 1369.1251; var float b = -14.96; var float result = a * b; // result = -91.51905