---
name: "fmodf"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/fmod"
---

# fmodf(3)

floating-point remainder functions

Part of [fmod(3)](/fmod/3.md).

## NAME

**fmod**, **fmodf**, **fmodl** – floating-point remainder functions

## LIBRARY

Math Library (libm, -lm)

## SYNOPSIS

**#include \<math.h\>**

*double*\

**fmod**(*double x*, *double y*);

*float*\

**fmodf**(*float x*, *float y*);

*long* *double*\

**fmodl**(*long double x*, *long double y*);

## DESCRIPTION

The **fmod**(), **fmodf**(), and **fmodl**() functions compute the floating-point remainder of *x*/ *y*.

## RETURN VALUES

If *y* is non-zero, the **fmod**(), **fmodf**(), and **fmodl**() functions return the value *x*,*-**i**\***y*, for some integer *i*, such that the result has the same sign as *x* and magnitude less than the magnitude of *y*. If *y* is zero, a  is produced.

## SEE ALSO

[math(3)](/math/3.md)

## STANDARDS

The **fmod**(), **fmodf**(), and **fmodl**() functions conform to ISO/IEC 9899:1999 (“ISO C99”).

## HISTORY

An **fmod**() function first appeared in Version 5 AT&T UNIX.
