Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
REMAINDER(3)		     Library Functions Manual		    REMAINDER(3)

NAME
     remainder,  remainderf,  remainderl,  remquo,  remquof,  remquol -- minimal
     residue functions

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include <math.h>

     double
     remainder(double x, double y);

     float
     remainderf(float x, float y);

     long double
     remainderl(long double x, long double y);

     double
     remquo(double x, double y, int *quo);

     float
     remquof(float x, float y, int *quo);

     long double
     remquol(long double x, long double y, int *quo);

DESCRIPTION
     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 |n - x/y| = 1/2 then n is even.	Consequently the
     remainder is computed exactly and |r| <= |y|/2.  But attempting to take the
     remainder when y is 0 or x is +/-infinity is an invalid operation that pro-
     duces a NaN.

     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.

SEE ALSO
     fmod(3), ieee(3), math(3)

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.

FreeBSD ports 15.quarterly	 March 30, 2008 		    REMAINDER(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=remquo&sektion=3&manpath=FreeBSD+15.1-RELEASE+and+Ports.quarterly>

home | help