如何用c++来表示arcsin(x)

又要开始学习了吗? 2020-11-30 07:58:19
不能使用指数和阶乘函数
...全文
1110 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2020-12-01
  • 打赏
  • 举报
回复
asin Calculates the arcsine. double asin( double x ); Routine Required Header Compatibility asin <math.h> ANSI, Win 95, Win NT For additional compatibility information, see Compatibility in the Introduction. Libraries LIBC.LIB Single thread static library, retail version LIBCMT.LIB Multithread static library, retail version MSVCRT.LIB Import library for MSVCRT.DLL, retail version Return Value The asin function returns the arcsine of x in the range –π/2 to π/2 radians. If x is less than –1 or greater than 1, asin returns an indefinite (same as a quiet NaN). You can modify error handling with the _matherr routine. Parameter x Value whose arcsine is to be calculated Example /* ASINCOS.C: This program prompts for a value in the range * -1 to 1. Input values outside this range will produce * _DOMAIN error messages.If a valid value is entered, the * program prints the arcsine and the arccosine of that value. */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> void main( void ) { double x, y; printf( "Enter a real number between -1 and 1: " ); scanf( "%lf", &x ); y = asin( x ); printf( "Arcsine of %f = %f\n", x, y ); y = acos( x ); printf( "Arccosine of %f = %f\n", x, y ); } Output Enter a real number between -1 and 1: .32696 Arcsine of 0.326960 = 0.333085 Arccosine of 0.326960 = 1.237711 Floating-Point Support Routines See Also acos, atan, cos, _matherr, sin, tan
みしつかん 2020-12-01
  • 打赏
  • 举报
回复
楼上正解~~~~~~~~~~~~~~~

65,182

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧