[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


fmod

Return the floating point remainder of x / y.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <math.h>

double fmod(double x, double y);
float fmodf(float, float);
long double fmodl(long double, long double);
Parameters:

Parameters for this function are:

x  
double, float or long double  
The value to compute  
y  
double, float or long double  
The divider  

Return:

fmod() returns, when possible, the value f such that x = i y + f for some integer i, and |f| < |y|. The sign of f matches the sign of x.

See Also:

"floor"

"ceil"

"fmod"

"fabs"

Example of fmod() usage.:
#include <math.h>
#include <stdio.h>

int main(void)
{
	double x = -54.4, y = 10.0;
	printf("Remainder of %f / %f = %f.\n",	x, y, fmod(x, y));

	return 0;
}

Output:
Remainder of -54.400000 / 10.000000 = -4.400000.      


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000