iOS中的round/ceil/floorf函数略解
来源:互联网 发布:php 提示非法字符串 编辑:程序博客网 时间:2024/05/18 07:09
extern float ceilf(float);
extern double ceil(double);
extern long double ceill(long double);
extern float floorf(float);
extern double floor(double);
extern long double floorl(longdouble);
extern float roundf(float);
extern double round(double);
extern long double roundl(longdouble);
round:如果参数是小数,则求本身的四舍五入。
ceil:如果参数是小数,则求最小的整数但不小于本身.
floor:如果参数是小数,则求最大的整数但不大于本身.
Example:如何值是3.4的话,则
3.4 -- round 3.000000
-- ceil 4.000000
-- floor 3.00000
CGRectMake(floorf(self.view.bounds.size.width*0.5f - 39.f*0.5f),self.view.bounds.size.height -57, 39, 39)
其中floorf(self.view.bounds.size.width*0.5f -39.f*0.5f)返回值为
140.000000这种形式
extern double ceil(double);
extern long double ceill(long double);
extern float floorf(float);
extern double floor(double);
extern long double floorl(longdouble);
extern float roundf(float);
extern double round(double);
extern long double roundl(longdouble);
round:如果参数是小数,则求本身的四舍五入。
ceil:如果参数是小数,则求最小的整数但不小于本身.
floor:如果参数是小数,则求最大的整数但不大于本身.
Example:如何值是3.4的话,则
3.4 -- round 3.000000
-- ceil 4.000000
-- floor 3.00000
CGRectMake(floorf(self.view.bounds.size.width*0.5f - 39.f*0.5f),self.view.bounds.size.height -57, 39, 39)
其中floorf(self.view.bounds.size.width*0.5f -39.f*0.5f)返回值为
140.000000这种形式
0 0
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数略解
- iOS中的round/ceil/floorf函数
- iOS-round、ceil、floorf函数
- ios中round/ceil/floorf函数的使用
- iOS开发中,round/ceil/floorf函数的理解
- Math中的round/ceil/floorf方法总结
- Math中的round/ceil/floorf方法总结
- matlab中的round、ceil、floor、fix函数
- SQL中的取整函数FLOOR、ROUND、CEIL、TRUNC、SIGN
- matlab中的rem()mod() floor() round() ceil()函数
- 第四章 使用DML语句更改数据
- Chrome调试js出现Uncaught SyntaxError: Unexpected identifier
- JAVA多线程机制之线程创建
- ubuntu安装JDK
- 正则表达式--常用用法及lookahead、lookbehind
- iOS中的round/ceil/floorf函数略解
- equals函数
- Tomcat下配置数据库连接池
- iOS---限制UITextView中的字数
- 数据库之存储过程
- iOS网络编程
- memset和wmemset微软官网解释
- JAVA虚拟机之六:虚拟机性能监控和故障处理工具
- Html5添加移动触摸设备的在线签名和涂鸦插件教程