AdditiveExpr

Add or subtract numerical values.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

AdditiveExpr

graphics/AdditiveExpr.png

Expr Expr

Description

The AdditiveExpr provides the usual arithmetic operations for adding and subtracting numerical values. Each operand is atomized so that it is either a single atomic value or an empty sequence. If one of the operands is atomized to an empty sequence, the result of the operation is also an empty sequence.

Examples

  • A sequence of expressions that consists of string and numeric literals:

    (59 - 17)

    As integer literals the operands are already atomic values and of valid type for the operator. Tamino returns the expected result 42.

  • Compute the years, in which all patients turned 18 years:

    for $a in input()/patient/born
    return $a + 18

    The variable $a is bound to the born element. After atomization the addition can be performed.