---
schema_version: "1"
id: 9896ed04f9b1cd31d2a5897ee38835126e28d657ab8cc765cdd776911b0591dc
title: mod
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-core-functions-mod.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-core-functions-mod
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 84da0bb1bdae3a0efcf67b84597ab5cf37ff90f1e4d20d0ff9cf11f837bf8f40
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# mod

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## mod(dividend: Number, divisor: Number): Number

Returns the modulo (the remainder after dividing the `dividend` by the `divisor`).

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>dividend</code></p></td><td><p>The number that serves as the dividend for the operation.</p></td></tr><tr><td><p><code>divisor</code></p></td><td><p>The number that serves as the divisor for the operation.</p></td></tr></tbody></table>

### Example

This example returns the modulo of the input values. Note that you can also use the
`mod(dividend, divisor)` notation (for example, `mod(3, 2)` to return `1`).

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ (3 mod 2), (4 mod 2), (2.2 mod 2) ]
```

#### Output

```JSON
[ 1, 0, 0.2]
```
