ADELIA |
VADELIA |
SADELIA |
WADELIA |
EADELIA |
(I/B) |
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(B) (C/S) |
Section for use
All
Syntax
REMAINDER VarId
Description
This instruction retrieves the remainder in a mathematical division in the specified variable VarId.
It must be placed immediately after the arithmetical expression of the division.
The divisional remainder sign is the same as the one of the dividend.
Rounding cannot be performed on a resulting field of the division in which the remainder is requested.
Restrictions
It is imperative that the division instruction only uses two terms, as shown in the example below:
A = B / C
REMAINDER R
An expression of the type A = ( ( B + C ) * D ) / E cannot have the REMAINDER instruction since several working fields are used to execute the expression. In such a case, you must write:
X = ( B + C ) * D
A = X / E
REMAINDER R
Example
W2N0 = 0
W2N0 = YEAR_2 / 4
REMAINDER W2N0
IF W2N0 = 0
* this is a leap year, February has 29 days
MAX_DAY_FEBR = 29
ELSE
MAX_DAY_FEBR = 28
END