Tamino XML Server Version 9.7
 —  XQuery 4 Reference Guide  —

MultiplicativeExpr

Multiply or divide numerical values.


Syntax

MultiplicativeExpr

graphics/MultiplicativeExpr.png

Expr Expr

Top of page

Description

The MultiplicativeExpr provides arithmetic operations for multiplying and dividing numerical values. Each operand is atomized so that it is either a single atomic value or an empty sequence. If either of the operands is atomized to an empty sequence, the result of the operation is also an empty sequence. If the two operands are of different types, type promotion is applied and the two operands are promoted to their least common type. The operation is then performed and either an atomic value is returned or a dynamic error such as division by zero issued.

The division operator is called div, since the typical division symbol / is already used in path expressions. The result of the div operation has the least common type of its operands unless both operands are integer values, in which case an atomic value of type xs:double is returned. The modulo operation (using the operator mod) returns the remainder of a division.

Top of page

Examples

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:

Top of page