Version 8.2.2
 —  X-Query Reference Guide  —

MultiplicativeExpr

Multiply or divide numeric values.


Syntax

MultiplicativeExpr

UnaryExpr | UnaryExpr * UnaryExpr | UnaryExpr div UnaryExpr | UnaryExpr mod UnaryExpr

Top of page

Description

A MultiplicativeExpr either consists of a simple UnaryExpr or of two or more operands to UnaryExpr separated by the operators that must be numeric values or can be converted to numeric values. If at least one operator is not a numeric value or cannot be converted, then the result is "NaN", a special value to indicate that this is not a number. Otherwise the numeric values are treated as double-length floating point numbers as specified in IEEE 754. This is also true for the division operator, although it is called div which is commonly used for the division of integer values (the typical division sign / is already used in path expressions). The modulo operation (using the operator mod) returns the remainder of a division.

In addition to "NaN" there are two other special values as specified in IEEE 754, namely positive and negative infinity. These are returned as "1.#INF" and "-1.#INF" respectively. You get these values if you perform queries such as 2 div 0 or 2 div -0.

Top of page

Compatibility

It corresponds to the expression MultiplicativeExpr defined in XPath, Section 3.5, Rule 6. This includes the XPath restriction that numbers cannot be used in scientific notation.

Top of page

Examples

Top of page

Related Expression

AdditiveExpr

Top of page