:man| Alphabetical   Categories   About us 
 
REMAINDER (3) | C library functions | Unix Manual Pages | :man

NAME

remainder, remainderf, remquo, remquof - minimal residue functions

CONTENTS

Library
Synopsis
Description
See Also
Standards
History

LIBRARY


.Lb libm

SYNOPSIS


.In math.h double remainder "double x" "double y" float remainderf "float x" "float y" double remquo "double x" "double y" "int *quo" float remquo "float x" "float y" "int *quo"

DESCRIPTION

remainder, remainderf, remquo, and remquof return the remainder r := x - n*y where n is the integer nearest the exact value of
.Bk -words x / y;
.Ek moreover if \*(Ba n -
.Sm off x / y \*(Ba
.Sm on = 1/2 then n is even. Consequently the remainder is computed exactly and
.Sm off \*(Ba r \*(Ba
.Sm on <=
.Sm off \*(Ba y \*(Ba/2.
.Sm on But attempting to take the remainder when y is 0 or x is ±oo is an invalid operation that produces a NaN.

The remquo and remquof functions also store the last k bits of n in the location pointed to by quo, provided that n exists. The number of bits k is platform-specific, but is guaranteed to be at least 3.

SEE ALSO

fmod(3), ieee(3), math(3)

STANDARDS

HISTORY

 
Created by Blin Media, 2008-2013