remainder, remainderf, remainderl, remainderd32, remainderd64, and remainderd128 Subroutines

Purpose

Returns the floating-point remainder.

Syntax

#include <math.h>

double remainder (x, y)
double x;
double y;

float remainderf (x, y)
float x; 
float y;

long double remainderl (x, y)
long double x; 
long double y ;
_Decimal32 remainderd32 (x, y)
_Decimal32 x;
_Decimal32 y;

_Decimal64 remainderd64 (x, y)
_Decimal64 x;
_Decimal64 y;

_Decimal128 remainderd128 (x, y)
_Decimal128 x;
_Decimal128 y;

Description

The remainder, remainderf, remainderl, remainderd32, remainderd64, and remainderd128 subroutines return the floating-point remainder r=x - ny when y is nonzero. The value n is the integral value nearest the exact value x/y. When | n x/y |=½ , the value n is chosen to be even.

Parameters

Item Description
x Specifies the value of the numerator.
y Specifies the value of the denominator.

Return Values

Upon successful completion, the remainder, remainderf, remainderl, remainderd32, remainderd64, and remainderd128 subroutines return the floating-point remainder r=x - ny when y is nonzero.

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

If x is infinite or y is 0 and the other is non-NaN, a domain error occurs, and a NaN is returned.