Arithmetic Operators+, -, *, /, ^, mod DescriptionThread SafetyExamples Using Arithmetic Operators
<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field> An expression can be composed by using the arithmetic operators + (addition), - (subtraction), * (multiplication), . (non-commutative multiplication), / (division), ^ (exponentiation), and mod (modular arithmetic). Such expressions can be one of four types: type `+`, type `*`, type `.`, or type `^`. That is, the expression a - b is of type `+` with operands a and -b. Similarly, a/b is of type `*` with operands a and b^(-1). a . b is of type `.` with operands a and b. Finally, a^b is of type `^`' with operands a and b. The representation used for these algebraic expressions is often referred to as sum-of-products form. An expression of type `^` has exactly two operands. (It is a syntax error to express a^b^c without parentheses). An expression of type `+`, type `*`, or type `.` can have two or more operands. For non-integer (complex) numeric powers y and (complex) numeric x, the expression x^y is generally evaluated as exp(y*ln(x)), where ln(x) is evaluated using the principal branch of the logarithm. The function surd can be used to compute real odd roots of negative real numbers. See surd for more information. The non-commutative multiplication operator, `.`, also called the "dot" operator, is used for linear algebra operations such as vector dot product, vector-vector products, matrix-vector products and matrix-matrix products. Due to the multiple possible interpretations of the . character in a Maple expression, it may be necessary to use extra spaces around it to ensure correct processing. See dot for details. If a and b are Arrays of the same dimensions (so NiMvLUkqQXJyYXlEaW1zRzYkSSpwcm90ZWN0ZWRHRidJKF9zeXNsaWJHNiI2I0kiYUdGKS1GJTYjSSJiR0Yp), then a . b and a * b both evaluate to the elementwise product of the Arrays. That is, the elements of the results are just the products of the corresponding elements of a and b. The element products are formed using the original operator, . or *. The -x operation returns x with its sign reversed. No multiplication is performed on x. If -undefined is used, it is simplified to undefined. Similarly, if -Float(undefined) is used, it is simplified to Float(undefined). Otherwise, if a symbol is used, it is returned with its sign reversed. For details on and example usage of the mod operator, see mod.