ios math.h 常用数学函数
1、 三角函数
double sin (double);正弦
double cos (double);余弦
double tan (double);正切
2 、反三角函数
double asin (double); 结果介于[-PI/2, PI/2]
double acos (double); 结果介于[0, PI]
double atan (double); 反正切(主值), 结果介于[-PI/2, PI/2]
double atan2 (double, double); 反正切(整圆值), 结果介于[-PI, PI]
3 、双曲三角函数
double sinh (double);
double cosh (double);
double tanh (double);
4 、指数与对数
double exp (double);求取自然数e的幂
double sqrt (double);开平方
double log (double); 以e为底的对数
double log10 (double);以10为底的对数
double pow(double x, double y);计算以x为底数的y次幂
float powf(float x, float y); 功能与pow一致,只是输入与输出皆为浮点数
5 、取整
double ceil (double); 取上整
double floor (double); 取下整
6 、绝对值
double fabs (double);求绝对值
double cabs(struct complex znum) ;求复数的绝对值
7 、标准化浮点数
double frexp (double f, int *p); 标准化浮点数, f = x * 2^p, 已知f求x, p ( x介于[0.5, 1] )
double ldexp (double x, int p); 与frexp相反, 已知x, p求f
8 、取整与取余
double modf (double, double*); 将参数的整数部分通过指针回传, 返回小数部分
double fmod (double, double); 返回两参数相除的余数
9 、其他
double hypot(double x, double y);已知直角三角形两个直角边长度,求斜边长度
double ldexp(double x, int exponent);计算x*(2的exponent次幂)
double poly(double x, int degree, double coeffs [] );计算多项式
nt matherr(struct exception *e);数学错误计算处理程序
Math.h放在哪里?那个是c的函数库:输入一个数学函数,然后双击这个函数-->右键用jump to definition就可以跳到这个头文件里了-->右键选Show in Finder,就知道这个头文件在哪里了。
ios math.h 常用数学函数的更多相关文章
- iOS math.h数学函数
在实际工作中有些程序不可避免的需要使用数学函数进行计算,比如地图程序的地理坐标到地图坐标的变换.Objective-C做为ANSI C的扩展,使用C标准库头文件<math.h>中定义的数学 ...
- VB.Net常用数学函数整理
System.Math 类中定义了用于数学计算的函数.Math 类包括三角函数.对数函数和其他常用数学函数.下列函数是在 System 名称空间的 Math 类中定义的函数. 注意:要使用这些函数 ...
- php常用数学函数
php常用数学函数1. bcadd 任意精度数的相加2. bcsub 任意精度数的减法3. bcmul 乘法, bcdiv除法 4. bcmod 取余数. (比%功能更强大)5. bcpow 幂函数运 ...
- ios 常用数学函数
需要 引入头文件 #import <math.h> 1. 三角函数 double sin (double);正弦 double cos (double);余弦 double tan ...
- C语言入门(6)——C语言常用数学函数
在编码过程中会经遇到数学运算,幸运的是C语言提供了非常丰富的数学函数库. 在数学中使用函数有时候书写可以省略括号,而C语言要求一定要加上括号,例如sin(pi/2)这种形式.在C语言的术语中,pi/2 ...
- 常用数学函数篇abs acos asin atan ceil cos exp frexp ldexp log pow sin sinh sqrt tan tanh
abs(计算整型数的绝对值) 相关函数 labs, fabs 表头文件 #include<stdlib.h> 定义函数 int abs (int j) 函数说明 abs()用来计算参数j的 ...
- C/C++常用数学函数
math.h/cmath(C++)数学函数库 1 三角函数 double sin (double); double cos (double); double tan (double) ...
- C语言常用数学函数及其用法
转自:http://blog.sina.com.cn/s/blog_8b5a0d0001011779.html 三角函数:(所有参数必须为弧度) 1.acos 函数申明:acos (double ...
- 自己模拟实现math.h中的函数
之前一直都很迷惑pow()函数时怎么实现的,对于整数次的幂我还能很容易做到,但是对于分数次幂就不是那么好做了.需要一些高等数学级数的知识. 我这里实现了求ln(x), pow(double x, do ...
随机推荐
- python commands 模块
commands 模块 通过python调用系统命令 只适用于linux commands是提供linux系统环境下支持使用shell命令的一个模块 commands.getoutput(cmd) 只 ...
- hdu 4535(排列组合之错排公式)
吉哥系列故事——礼尚往来 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Tota ...
- 静态变量(static)的特点
静态变量(static):有局部变量,也有全局变量. 静态局部变量:在函数体内用static说明的变量称为静态局部变量,属于静态类别. 特点: (1)它占据一个永久性的存储单元.随着文件的存在而存在. ...
- json手动解析详解
项目中有时候仅仅需要一个或者多个字段时可以使用这种解析方式,省去创建实体类. 1.首先讲解下最基本的数据格式. 例如: String json="{'name':'小明','action': ...
- VS如何反汇编
1. 打开反汇编窗口:调试模式下,按Ctrl+F11.2. 术语: 2.1 ESP(Extended Stack Pointer): 堆栈指针,寄存器存放当前线程的栈顶指针: i.e: move eb ...
- ajax简单案例
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"% ...
- PHP message: PHP Fatal error: require(): Failed opening required
PHP message: PHP Warning: require(/data/wwwroot/blog.sgfoot.com/bootstrap/autoload.php): failed to o ...
- 聊聊、Zookeeper Linux 启动
Zookeeper 在 windows 下安装比较简单,属于无脑式安装,下载下来双击脚本就可以了.前面的文章中也有介绍,今天我来写写 Linux 下的安装,以及所碰到的坑. 首先,登陆 Linux 系 ...
- Understanding Objective-C Blocks
The aim of this tutorial is to give a gentle introduction to Objective-C blocks while paying special ...
- 126. Word Ladder II(hard)
126. Word Ladder II 题目 Given two words (beginWord and endWord), and a dictionary's word list, find a ...