XPath/XQuery numeric-unary-minus function

Summary

Returns its operand with the sign reversed: (- $arg).

Operator Mapping

Defines the semantics of the unary "-" operator when applied to a numeric value.

Signature

op:numeric-unary-minus(
$arg as xs:numeric
) as xs:numeric

Rules

General rules: see .

The returned value is an instance of xs:integer, xs:decimal, xs:double, or xs:float depending on the type of $arg.

For xs:integer and xs:decimal arguments, 0 and 0.0 return 0 and 0.0, respectively. For xs:float and xs:double arguments, NaN returns NaN, 0.0E0 returns -0.0E0 and vice versa. INF returns -INF. -INF returns INF.