首页 >> 百科精选 >

数学中的函数。

2023-01-16 01:25:27 来源: 用户: 

您好,现在柳柳来为大家解答以上的问题。数学中的函数。相信很多小伙伴还不知道,现在让我们一起来看看吧!

1、相关函数 labs, fabs 表头文件 #include 定义函数 int abs (int j) 函数说明 abs()用来计算参数j的绝对值,然后将结果返回。

2、 返回值 返回参数j的绝对值结果。

3、 范例 #ingclude main(){int ansert;answer = abs(-12);printf("|-12| = %d", answer);} 执行 |-12| = 12   acos(取反余弦函数数值) 相关函数 asin , atan , atan2 , cos , sin , tan 表头文件 #include 定义函数 double acos (double x); 函数说明 acos()用来计算参数x的反余弦值,然后将结果返回。

4、参数x范围为-1至1之间,超过此范围则会失败。

5、 返回值 返回0至PI之间的计算结果,单位为弧度,在函数库中角度均以弧度来表示。

6、 错误代码 EDOM参数x超出范围。

7、 附加说明 使用GCC编译时请加入-lm。

8、 范例 #include main (){double angle;angle = acos(0.5);printf("angle = %f", angle);} 执行 angle = 1.047198   asin(取反正弦函数值) 相关函数 acos , atan , atan2 , cos , sin , tan 表头文件 #include 定义函数 double asin (double x) 函数说明 asin()用来计算参数x的反正弦值,然后将结果返回。

9、参数x范围为-1至1之间,超过此范围则会失败。

10、 返回值 返回-PI/2之PI/2之间的计算结果。

11、 错误代码 EDOM参数x超出范围 附加说明 使用GCC编译时请加入-lm 范例 #includemain(){double angle;angle = asin (0.5);printf("angle = %f",angle);} 执行 angle = 0.523599   atan(取反正切函数值) 相关函数 acos,asin,atan2,cos,sin,tan 表头文件 #include 定义函数 double atan(double x); 函数说明 atan()用来计算参数x的反正切值,然后将结果返回。

12、 返回值 返回-PI/2至PI/2之间的计算结果。

13、 附加说明 使用GCC编译时请加入-lm 范例 #includemain(){double angle;angle =atan(1);printf("angle = %f",angle);} 执行 angle = 1.570796。

本文就为大家分享到这里,希望小伙伴们会喜欢。

  免责声明:本文由用户上传,与本网站立场无关。财经信息仅供读者参考,并不构成投资建议。投资者据此操作,风险自担。 如有侵权请联系删除!

 
分享:
最新文章
站长推荐