Export (0) Print
Expand All
and
div
eof
not
or
xor
Expand Minimize
This topic has not yet been rated - Rate this topic

remquo, remquof, remquol

Visual Studio 2013

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
);
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.

Function

Required 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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.