__remquod32(), __remquod64(), __remquod128() — Computes the remainder.

Standards

Standards / Extensions C or C++ Dependencies
Language Environment® both z/OS® V1.11

Format

#define __STDC_WANT_DEC_FP__
#include <math.h>

_Decimal32  __remquod32(_Decimal32 x, _Decimal32 y, int *quo); 
_Decimal64  __remquod64(_Decimal64 x, _Decimal64 y, int *quo); 
_Decimal128 __remquod128(_Decimal128 x, _Decimal128 y, int *quo);

General description

The __remquo() functions compute the same remainder as the remainder functions. In the object pointed to by quo they store a value whose sign is the sign of x or y and whose magnitude is congruent modulo 2 to the power n to the magnitude of the integral quotient of x or y, where n is an implementation defined integer greater than or equal to 3.

Notes:
  1. These functions work in IEEE decimal floating-point format. See IEEE decimal floating-point for more information.
  2. To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.

Returned value

The __remquo() functions return x REM y.

Example

⁄* CELEBR24

   This example illustrates the __remquod64() function.

*⁄

#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
void main() {
   _Decimal64 x, y, z;
   int n;

   x = 3.0DD;
   y = 3.5DD;
   z = __remquod64(x, y, &n);

   printf("__remquod64( %Df, %Df, %d ) = %Df\n", x, y, n, z);
}

Related information