# Minix Man Pages

home | helpREMAINDER(3) BSD Library Functions Manual REMAINDER(3)NAMEremainder,remainderf,remquo,remquof-- remainder functionsLIBRARYMath Library (libm, -lm)SYNOPSIS#include<math.h>doubleremainder(doublex,doubley);floatremainderf(floatx,floaty);doubleremquo(doublex,doubley,int*quo);floatremquof(floatx,floaty,int*quo);DESCRIPTIONProvided thaty!= 0 , theremainder() andremainderf() functions calculate the floating-point remainderrofr=x-ny, wherenis the integral value nearest to the exact value ofx/y. If |n-x/y| = 1/2 , the valuenis chosen to be even. Consequently, the remainder is computed exactly and |r| <= |y| / 2 . Also theremquo() andremquof() functions calculate the remainder as described above. But these additionally usequoto store a value whose sign is the sign ofx/yand whose magnitude is congruent modulo2^kto the magnitude of the integral quotient ofx/y, wherekis an implementation-defined integer greater than or equal to 3. The rationale of theremquo() family of functions relates to situations where only few bits of the quotient are required. The exact representation of the quotient may not be meaningful whenxis large in magnitude compared toy.RETURN VALUESThe functions return the remainder independent of the rounding mode. Ifyis zero ,NaNis returned and a domain error occurs. A domain error occurs and aNaNis returned also whenxis infinite butyis not aNaN. If eitherxoryisNaN, aNaNis always returned.SEE ALSOdiv(3), fast_remainder32(3), fmod(3), math(3)STANDARDSThe described functions conform to ISO/IEC 9899:1999 (``ISO C99''). BSD September 18, 2011 BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | SEE ALSO | STANDARDS