函数名: 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