atan数学函数应用实例

函数名: atan
功 能: 反正切函数(C++)
用 法: double atan(double x);
输 入: -∞~+∞
(注:受限于形式参数的范围,实际输入范围为double型的范围,即负值取值范围为 -1.7976E+308 到 -4.94065645841246544E-324,正值取值范围为 4.94065645841246544E-324 到 1.797693E+308)
输 出: -pi/2~pi/2

程序例 

#include<stdio.h> 
#include<math.h> 
int main(void) 
{ 
    double result; 
    double x=0.5; 
    result=atan(x); 
    printf("Thearctangentof%lfis%lf\n",x,result); 
    return(0); 
} 
Makefile 文件:

CXX=g++
CFLAGS=-O3 -Wall -fmessage-length=0 -fPIC -DARCH_x86
OBJS=atan.o
LIBS+= 
TARGET= Tatan
$(TARGET):$(OBJS)
    $(CXX) -o $(TARGET) $(OBJS) $(CFLAGS) $(LIBS)
    chmod 6755 $(TARGET)
all:$(TARGET)
install: all
    chmod 6755 $(TARGET)
clean:
    rm -f $(OBJS) $(TARGET)

程序运行结果:

[root@localhost atan]# make
make: Warning: File `Makefile' has modification time 59 s in the future
cc -O3 -Wall -fmessage-length=0 -fPIC -DARCH_x86   -c -o atan.o atan.c
g++ -o Tatan atan.o -O3 -Wall -fmessage-length=0 -fPIC -DARCH_x86 
chmod 6755 Tatan
make: warning:  Clock skew detected.  Your build may be incomplete.
[root@localhost atan]# ./Tatan 
The arctangent of 0.500000 is 0.463648



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值