#include<stdio.h>
//#include<stdlib.h>
double modf(double val ,double *ip);//实现双精度浮点数拆分小数部分返回,整数部分保存在IP中;
int main()
{double zs=0.0;
double xs=0.0;
xs=modf(4.18,&zs);
printf("xs=%lf,zs=%lf\n",xs,zs);
return 0;
}
double modf(double val, double *ip)
{
*ip=(int)val;
return val-*ip;
}