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

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