# op:double-mod

Return the remainder of dividing $double-var1 by $double-var2. The mod operator invokes the double-mod operator.

To learn more about using this operator with NaN, positive infinity, or negative infinity operands, see the W3C numeric-mod operator description.

### Signatures

op:double-mod(xs:double $double-var1, xs:double $double-var2) —> xs:double

### Arguments

Data Type | Argument | Description
--- | --- | ---
xs:double | $double-var1 | Represents a double precision (64 bit) floating point number, for example: 1.1.
xs:double | $double-var2 | Represents a double precision (64 bit) floating point number, for example: 1.1.

### Returns

Returns the remainder of dividing $double-var1 by $double-var2.

### Examples

#### Simple

Invoking double-mod("1.25","1.0") returns the double precision (64 bit) floating point value: .25 because 1.25 divided by 1.0 results in 1 with the remainder: .25. The remainder: .25 is returned as shown in the following example query:

    <double-mod>{op:double-mod("1.25","1.0")}</double-mod>

The preceding query generates the following result:

    <double-mod>0.25</double-mod>

#### Divide by Zero

Invoking double-mod("2.2","0")returns a NaN value as shown in the following example query:

    <double-mod>{op:double-mod("2.2","0")}</double-mod>

The preceding query generates the following result:

    <double-mod>NaN</double-mod>

Related Topics

W3C double data type description.

W3C numeric-mod operator description.