remquo, remquof, remquol

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see remquo, remquof, remquol on docs.microsoft.com. 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  
);  
  

Parameters

numer
The numerator.

denom
The denominator.

quo
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.

FunctionRequired header
remquo, remquof, remquol<math.h>

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  

System::Math::IEEERemainder

Floating-Point Support
ldiv, lldiv
imaxdiv
fmod, fmodf
remainder, remainderf, remainderl

Show: