--- type: "fhirpath-operator" title: "FHIRPath Operator: mod (mod)" operator: "mod" category: "Math" section: "6.6.6" source: "fhirpath/operations.json" --- # FHIRPath Operator: mod (mod) Computes the remainder of the truncated division of its arguments (supported for Integer and Decimal). ``` fhirpath 5 mod 2 // 1 5.5 mod 0.7 // 0.6 5 mod 0 // empty ({ }) ``` ## Summary - **Category**: Math - **Section**: `6.6.6` - **Left Argument**: `Integer | Decimal` - **Right Argument**: `Integer | Decimal` - **Return Type**: `Integer | Decimal` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Computes the remainder of the truncated division of its arguments. Supported for Integer and Decimal. Each operand must be a single element. Modulo by zero results in empty collection. ## Type Mapping - `Integer-Integer` - `Decimal-Decimal` - `Integer-Decimal` - `Decimal-Integer`