carta
remainderl(3)

remainderl3

Minimal residue functions

Part of remainder(3).

Usage

double

float

long double

double

float

long double

Library

Math Library (libm, -lm)

Overview

remainder(), remainderf(), remainderl(), remquo(), remquof(), and remquol() return the remainder r := x - n∗y where n is the integer nearest the exact value of x/y; moreover if Fan - x/y = 1/2 then n is even. Consequently the remainder is computed exactly and Far

Fay/2. But attempting to take the remainder when y is 0 or x is is an invalid operation that produces a .

The remquo(), remquof(), and remquol() functions also store the last k bits of n in the location pointed to by quo, provided that n exists. The number of bits k is platform-specific, but is guaranteed to be at least 3.

History

  • FreeBSD 16.0-CURRENT (2026-10-27) to FreeBSD 15.0-RELEASE: the text shown here
  • FreeBSD 14.5-RELEASE to FreeBSD 13.3-RELEASE
  • FreeBSD 13.2-RELEASE to FreeBSD 13.0-RELEASE
  • FreeBSD 12.4-RELEASE
  • FreeBSD 12.3-RELEASE
  • FreeBSD 12.2-RELEASE
  • FreeBSD 12.1-RELEASE
  • FreeBSD 12.0-RELEASE
  • FreeBSD 11.4-RELEASE
  • FreeBSD 11.3-RELEASE
  • FreeBSD 11.2-RELEASE
  • FreeBSD 11.1-RELEASE
  • FreeBSD 11.0-RELEASE
  • FreeBSD 10.4-RELEASE
  • FreeBSD 10.3-RELEASE
  • FreeBSD 10.2-RELEASE
  • FreeBSD 10.1-RELEASE
  • FreeBSD 10.0-RELEASE
  • FreeBSD 9.3-RELEASE
  • FreeBSD 9.2-RELEASE
  • FreeBSD 9.1-RELEASE
  • FreeBSD 9.0-RELEASE
  • FreeBSD 8.4-RELEASE
  • FreeBSD 8.3-RELEASE
  • FreeBSD 8.2-RELEASE
  • FreeBSD 8.1-RELEASE
  • FreeBSD 8.0-RELEASE

Standards

The remainder(), remainderf(), remainderl(), remquo(), remquof(), and remquol() routines conform to ISO/IEC 9899:1999 (“ISO C99”). The remainder is as defined in IEEE Std 754-1985.

History

The remainder() and remainderf() functions appeared in 4.3BSD and FreeBSD 2.0, respectively. The remquo() and remquof() functions were added in FreeBSD 6.0, and remainderl() and remquol() were added in FreeBSD 8.0.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.