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什么意思
文章分享:https://www.cdcxhl.com/article22/ddchhjc.html

成都网站建设公司_创新互联,为您提供电子商务定制网站做网站手机网站建设微信小程序

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都app开发公司