☜ | Arithmetic OperatorsDraft MDC Standard | ☞ |
The binary operators + - * / \ # ** are called the arithmetic binary operators. They operate on the numeric interpretations of their operands, and they produce numeric (in one case, integer) results.
+ | produces the algebraic sum. | |
- | produces the algebraic difference. | |
* | produces the algebraic product. | |
/ | produces the algebraic quotient. Note that the sign of the quotient is negative if and only if one operand is positive and one operand is negative. Division by zero causes an error condition with ecode = "M9". | |
\ | produces the integer interpretation of the result of the algebraic quotient. | |
# | produces the value of the left operand modulo the right
operand. It is defined only for non-zero values of its right
operand, as follows. A # B = A - (B * floor(A/B)) where floor (x) = the largest integer '> x. A value of 0 (zero) for B will produce an error condition with ecode = "M9". | |
** | produces the exponentiated value of the left operand, raised to the power of the right operand. On an attempt to compute 0 ** (a negative number), an error condition occurs with ecode = "M9". On an attempt to compute 0 ** 0, an error condition occurs with ecode = "M94". On an attempt to compute the result of an exponentiation, the true value of which is a complex number with a non-zero imaginary part, an error condition occurs with ecode = "M95". |
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.
This page most recently updated on 15-Nov-2023, 13:17:03.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)