资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

c语言库函数modf讲解 c语言mod什么意思

C语言里的modf函数 怎么用??

函数名:modf

创新互联是专业的通榆网站建设公司,通榆接单;提供网站制作、成都网站设计,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行通榆网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

头文件:math.h

函数原型:double

modf(double

x,

double

*ipart)

函数用途:分解x,以得到x的整数和小数部分

输入参数:x

待分解的数

输出参数:ipath

x

的整数部分

返回值:x

的小数部分

实例:

#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

",number,

integer,

fraction);

return

c语言中modf函数的具体用法,包括那个地方写那变量,例如求变量n的小数部分。

modf 函数名: modf

功 能: 把数分为整数和小数 (The modf function breaks down the floating-point value x into fractional and integer parts, each of which has the same sign as x. The signed fractional portion of x is returned. The integer portion is stored as a floating-point value at intptr.

用 法: double modf(double x, double *intptr);

程序例:

#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;

}

C语言里的modf函数  怎么用??

函数名:modf

头文件:math.h

函数原型:double

modf(double

x,

double

*ipart)

函数用途:分解x,以得到x的整数和小数部分

输入参数:x

待分解的数

输出参数:ipath

x

的整数部分

返回值:x

的小数部分

实例:

#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

",number,

integer,

fraction);

return


分享文章:c语言库函数modf讲解 c语言mod什么意思
分享路径:http://cdkjz.cn/article/ddchhjc.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220