Rem= Operator

Divides the value of a variable by the value of an expression, then changes the variable to the remainder.

Syntax

variable Rem= expression

Parts

variable
A numeric variable or property.
expression
A numeric expression.

Instructions

The two statements that follow operate the same.

variable Rem= expression
variable = variable Rem expression

The element on the left side of Rem= can be a scalar variable, a property, or an element of an array. If it is a property, then it cannot have the modifier @ReadOnly.

Rem= divides the variable or property on its left side by the value on its right side to get a quotient and a remainder. Then it changes the variable or property on its left side to the remainder.

Rem does some of the same operations as Rem=. Thus, the sign of the variable or property (positive or negative) becomes the sign of the expression. This is also where Rem= is different from Mod=. Mod= takes its sign from the variable or property.

Data types

TODO

Division by zero

TODO

Examples

x = -42
x Rem= 10
After execution
VariableValue
x2

See also