Skip to content

fmod, fmodf : floating-point remainder (modulo)

#include <math.h>
double fmod(double x, double y)
float fmodf(float x, float y)
```### Description
The fmod and fmodf functions compute the floating-point remainder of x/y (x modulo y).### Returns
The fmod function returns the value for the largest integer i such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y. fmod(x,0) returns NaN, and sets errno to EDOM. You can modify error treatment for these functions using matherr.
---
**Authoritative source**: BUSMASTER DITA help source `fmod.dita`, compiled into `BUSMASTER.CHM` with the application.