# Fmod Script and chart function

fmod() is a generalized modulo function that returns the remainder part of the integer division of the first argument (the dividend) by the second argument (the divisor). The result is a real number. Both arguments are interpreted as real numbers, that is, they do not have to be integers.

Syntax:

fmod(a, b)

Return data type: numeric

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| a | Dividend |
| b | Divisor |

Examples and results:

Examples and results

| Examples | Results |
| --- | --- |
| `fmod( 7,2<br>)` | Returns 1 |
| `fmod( 7.5,2<br>)` | Returns 1.5 |
| `fmod( 9,3<br>)` | Returns 0 |
| `fmod( -4,3<br>)` | Returns -1 |
| `fmod( 4,-3<br>)` | Returns 1 |
| `fmod( -4,-3<br>)` | Returns -1 |

## Learn more

* [Div Script and chart function](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/GeneralNumericFunctions/div.htm)