remquo, remquof, remquol, remquod32, remquod64, and remquod128 Subroutines

Purpose

Returns the floating-point remainder.

Syntax

#include <math.h>

double remquo (x, y, quo)
double x; 
double y;
int *quo;

float remquof (x, y, quo)
float x; 
float y;
int *quo;

long double remquol (x, y, quo)
long double x;
long double y;
int *quo;
_Decimal32 remquod32 (x, y, quo)
_Decimal32 x;
_Decimal32 y;
int *quo;

_Decimal64 remquod64 (x, y, quo)
_Decimal64 x;
_Decimal64 y;
int *quo;

_Decimal128 remquod128 (x, y, quo)
_Decimal128 x;
_Decimal128 y;
int *quo;

Description

The remquo, remquof, remquol, remquod32, remquod64, remquod128 subroutines compute the same remainder as the remainder, remainderf, remainderl remainderd32, remainderd64, and remainder128 functions, respectively. In the object pointed to by quo, they store a value whose sign is the sign of x/y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where n is 3.

An application wishing to check for error situations should set the errno global variable to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these subroutines. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.

Parameters

Item Description
x Specifies the value of the numerator.
y Specifies the value of the denominator.
quo Points to the object where a value whose sign is the sign of x/y is stored.

Return Values

The remquo, remquof, remquol, remquod32, remquod64, and remquod128 subroutines return x REM y.

If x or y is NaN, a NaN is returned.

If x is ±Inf or y is zero and the other argument is non-NaN, a domain error occurs, and a NaN is returned.