6.11.150 remainderl Function
Calculates x
REM y
as a long double precision
value.
Include
<math.h>
Prototype
long double remainderl(long double x, long double y);
Arguments
x
- a double precision floating-point value
y
- a double precision floating-point value
Return Value
Returns the remainder x
REM y
, being x −
ny
, where n
is the nearest integer to
the exact value of x/y
when y
is not 0. The rounding
mode is ignored. If the remainder is 0, its sign shall be the same as that of
x
.
Example
See the notes at the beginning of this chapter or section for
information on using printf()
or scanf()
(and other functions reading and writing the stdin
or
stdout
streams) in the example code.
#include <math.h>
#include <stdio.h>
int main(void)
{
long double x,y,z;
x = 7.0;
y = 3.0;
z = remainderl(x, y);
printf("%Lf REM %Lf is %Lf\n", x, y, z);
}
Example Output
7.000000 REM 3.000000 is 1.000000