Pulser3 Programming Manual Download PDF

Getting the Remainder from the Division Operation (a = b % c)

It divides the value of b by the value of c and loads the remainder into the variable a.

Example:

(IT DIVIDES 5 BY 2 AND LOADS THE REMAINDER INTO VARIABLE #0)

G65 L23 P#0 Q5 R2

(IT DIVIDES VARIABLE #1 BY #2 AND LOADS)

(THE REMAINDER INTO #0)

G65 L23 P#0 Q#1 R#2

Example:

(IT DIVIDES 5 BY 2 AND LOADS THE REMAINDER INTO VARIABLE #0)

#0 = 5 % 2

(IT DIVIDES VARIABLE #1 BY #2 AND LOADS)

(THE REMAINDER INTO #0))

#0 = #1 % #2

 

When the divisor value (c) is set to 0, <ALM79> a division by zero error occurs in Macro Commands.