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

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