remquo, remquof, remquol
Collapse the table of content
Expand the table of content

remquo, remquof, remquol


Computes the remainder of two integer values, and stores an integer value with the sign and approximate magnitude of the quotient in a location that's specified in a parameter.

double remquo( 
   double numer,
   double denom,
   int* quo
float remquo( 
   float numer,
   float denom,
   int* quo
); /* C++ only */
long double remquo( 
   long double numer,
   long double denom,
   int* quo
); /* C++ only */
float remquof( 
   float numer,
   float denom,
   int* quo
long double remquol( 
   long double numer,
   long double denom,
   int* quo


The numerator.


The denominator.


A pointer to an integer to store a value that has the sign and approximate magnitude of the quotient.

remquo returns the floating-point remainder of x / y. If the value of y is 0.0, remquo returns a quiet NaN. For information about the representation of a quiet NaN by the printf family, see printf, _printf_l, wprintf, _wprintf_l.

The remquo function calculates the floating-point remainder f of x / y such that x = i * y + f, where i is an integer, f has the same sign as x, and the absolute value of f is less than the absolute value of y.

C++ allows overloading, so you can call overloads of remquo that take and return float or long double values. In a C program, remquo always takes two doubles and returns a double.



Required header

remquo, remquof, remquol


For compatibility information, see Compatibility.


// crt_remquo.c
// This program displays a floating-point remainder.

#include <math.h>
#include <stdio.h>

int main( void )
   double w = -10.0, x = 3.0, z;
   int quo = 0;

   z = remquo(w, x, &quo);
   printf("The remainder of %.2f / %.2f is %f\n", w, x, z);
   printf("Approximate signed quotient is %d\n", quo);
The remainder of -10.00 / 3.00 is -1.000000
Approximate signed quotient is -3

.NET Framework Equivalent

© 2016 Microsoft