#include <math.h> double
remainder (double x double y); float
remainderf (float x float y); double
remquo (double x double y int *quo); float
remquof (float x float y int *quo);
DESCRIPTION
remainder (,);
remainderf (,);
remquo (,);
and
remquof ();
return the remainder
Fa r
:=
Fa x
-
Fa n*y
where
Fa n
is the integer nearest the exact value of
-words
Fa x Ns / Ns Fa y ;
moreover if
\*(Ba Fa n
-
Fa x No / Fa y No \*(Ba
=
1/2
then
Fa n
is even.
Consequently
the remainder is computed exactly and
\*(Ba Fa r \*(Ba
\*(Ba Fa y \*(Ba/2
But attempting to take the remainder when
Fa y
is 0 or
Fa x
is is an invalid operation that produces a .
The
remquo ();
and
remquof ();
functions also store the last
k
bits of
Fa n
in the location pointed to by
Fa quo ,
provided that
Fa n
exists.
The number of bits
k
is platform-specific, but is guaranteed to be at least 3.
The
remainder (,);
remainderf (,);
remquo (,);
and
remquof ();
routines conform to
St -isoC-99 .
The remainder is as defined in
St -ieee754 .
HISTORY
The
remainder ();
and
remainderf ();
functions appeared in
BSD 4.3
and
Fx 2.0 ,
respectively.
The
remquo ();
and
remquof ();
functions were added in
Fx 6.0 .