fmod (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Calculates the floating-point remainder.

double fmod(    doublex,double y);

Parameters

  • x, y
    Floating-point values.

Return Values

fmod returns the floating-point remainder of x / y.

If the value of y is 0.0, fmod returns a quiet NaN.

For information about representation of a quiet NaN by the printf family, see printf.

Remarks

The fmod function calculates the floating-point remainder f of x / y such that x = i * y + f, where i is an integer, f has the same sign as x, and the absolute value of f is less than the absolute value of y.

Example

/* FMOD.C: This program displays a
 * floating-point remainder.
 */


void main( void )
{
   double w = -10.0, x = 3.0, y = 0.0, z;

   z = fmod( x, y );
   printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
   printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );
}

Output

The remainder of -10.00 / 3.00 is -1.000000

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

ceil | fabs | floor

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.