---
schema_version: "1"
id: 89e6b269392b2ca38ac85deb75054cae7a61e9db1e91729ddd2c35b55534544c
title: mod
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.9/dw-core-functions-mod.md
canonical_url: https://docs.mulesoft.com/dataweave/2.9/dw-core-functions-mod
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8d47574ec2f6bacef7e2b87323f6ea25cbc9bf39bfba38cdc29982639aec81f0
description: MuleSoft Documentation Site
release: "2.9"
latest: false
---
---
product: DataWeave
version: 2.9
---

# 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]
```
