Separate integer and fractional parts.
Compatibility:This function is compatible with the following targets:
|
|
#include <math.h>
double modf(double value, double *iptr);
float fmodf(float value, float *iptr);
long double modfl(long double value,  
long double *iptr);
Parameters for this function are:
#include <math.h>
#include <stdio.h>
int main(void)
{
double i, f, value = 27.04;
f = modf(value, &i);
printf("The fractional part of %f is %f.\n", value, f);
printf("The integer part of %f is %f.\n", value, i);
return 0;
}
Output:
The fractional part of 27.040000 is 0.040000.
The integer part of 27.040000 is 27.000000.
[ 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