Produces the value of an arithmetic modulo operation on two operands, after interpreting both operands as numbers.
Examples
The following examples perform modulo operations on numeric literals, returning the remainder:
WRITE "37 # 10 = ",37 # 10,! // 7
WRITE "12.5 # 3.2 = ",12.5 # 3.2,! // 2.9
The following example performs string arithmetic. When operating on strings, they are converted to numeric values (according the values described in Variable Typing and Conversion) before the modulo operator is applied. Hence, the following two expressions are equivalent:
WRITE "8 apples" # "3 oranges",! // 2
WRITE 8 # 3 // 2
Because InterSystems IRIS® evaluates a string with no leading numeric characters to zero, a right operand of this kind yields a <DIVIDE> error.