ios oc math.h常用函数
来源:互联网 发布:pc装mac os x双系统 编辑:程序博客网 时间:2024/05/18 21:06
介绍一下Objective-c常用的函数,常数变量
算术函数
(例)
srand(time(nil)); //随机数初期化
int val = rand()P; //0~49之间的随机数int abs(int a)整数的绝对值
(例)int val = abs(-8);
→8
※浮点数的时候用fabs。double fabs(double a)浮点数的绝对值
(例)double val = fabs(-12.345);
→12.345
※整数的时候用abs。double floor(double a)返回浮点数整数部分(舍弃小数点)
(例)double val = floor(12.345);
→12.000double ceil(double a);返回浮点数整数部分(舍弃小数点部分,往个位数进1)
(例)double val = ceil(12.345);
→13.000double pow(double a, double b)a的b次方
(例)double val = pow(2, 3);
→8double sqrt(double a)a的平方根
(例)double val = sqrt(2);
→1.41421356
三角函数
指数函数
常数
0 0
- ios oc math.h常用函数
- iOS math.h 常用数学函数
- iOS math.h 常用数学函数
- iOS中math.h常用函数说明
- iOS math.h 常用数学函数
- iOS math.h 常用数学函数
- IOS math.h函数
- IOS-升级103 iOS math.h 常用数学函数
- ios math.h 常用数学函数
- math.h常用数学函数
- math.h中的常用函数
- IOS开发 - math.h常用数学方法
- math.h中一些常用函数
- C语言math.h中的常用函数
- math.h中一些常用函数
- math.h中一些常用函数
- math.h中一些常用函数
- math.h中一些常用函数
- Android - Adapter
- [XP操作系统]窗口文件夹中使用常见任务
- 实现JSP页面跳转
- linux线程互斥锁
- k好数
- ios oc math.h常用函数
- Linux内核的5个子系统
- linux strcat函数
- UVa 10055 Hashmat the brave warrior
- Spring Security3.1实践
- 特征变换以及维度下降——Principal Component Analysis
- linux命令之 cut awk sed grep 篇
- 黑马程序员-java代理笔记
- linux驱动编程--内核时钟浅析