asin数学函数应用实例
来源:互联网 发布:mac如何制作启动盘 编辑:程序博客网 时间:2024/04/29 13:46
头文件:#include <math.h>
定义函数:double asin (double x)
函数说明:asin()用来计算参数x 的反正弦值,然后将结果返回。参数x 范围为-1 至1 之间,超过此范围则会失败。
返回值:返回-PI/2 之PI/2 之间的计算结果。
错误代码:EDOM 参数x 超出范围。
注意,使用 GCC 编译时请加入-lm。
范例
#include <stdio.h>#include <math.h>int main(){ double angle; angle = asin (0.5); printf("angle = %f\n", angle); return 0;}Makefile文件:
CXX=g++CFLAGS=-O3 -Wall -fmessage-length=0 -fPIC -DARCH_x86OBJS=asin.oLIBS+= TARGET= Tasin$(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 asin]# makemake: Warning: File `Makefile' has modification time 13 s in the futurecc -O3 -Wall -fmessage-length=0 -fPIC -DARCH_x86 -c -o asin.o asin.cg++ -o Tasin asin.o -O3 -Wall -fmessage-length=0 -fPIC -DARCH_x86 chmod 6755 Tasinmake: warning: Clock skew detected. Your build may be incomplete.[root@localhost asin]# ./Tasin angle = 0.523599
0 0
- asin数学函数应用实例
- asin () 函数
- asin 函数
- atan2数学函数应用实例
- atan数学函数应用实例
- abs数学函数应用实例
- acos数学函数应用实例
- ceil数学函数应用实例
- hive函数 -- asin
- ASIN
- asin()
- asin
- asin
- 常用数学函数应用
- 数学函数的异常捕获——Ada应用实例之十
- 【JS】前端数学函数应用
- Java的数学函数应用
- matlab2c使用c++实现matlab函数系列教程-asin函数
- 我的书签栏
- ES6学习札记
- JAVA_SE使用反射机制new实例简例
- [C++]二叉树应用--Huffman code
- willMoveToParentViewController和didMoveToParentViewController
- asin数学函数应用实例
- 编译原理实验二:语义分析
- 单例模式の懒汉式和饿汉式
- 无法加载 MySQL ODBC 5.3 Unicode Driver ODBC 驱动程序的安装例程,因为存在错误代码126.
- C#入门之流程控制练习题(排序)
- iframe.js
- java web_笔记
- Android 开发经验(转)
- linux 内存管理qqq