modf

来源:互联网 发布:新西兰的淘宝网 编辑:程序博客网 时间:2024/05/21 09:49
modf
功 能: 把数分为整数和小数
#include <math.h>#include <stdio.h>int main(void){double fraction, integer;double number = 100000.567;fraction = modf(number, &integer);printf("The whole and fractional parts of %lf are %lf and %lf\n",number, integer, fraction);return 0;}
The whole and fractional parts of 100000.567000 are 100000.000000 and 0.567000
原创粉丝点击