ceil
来源:互联网 发布:算法导论第三版.pdf 编辑:程序博客网 时间:2024/05/21 14:06
用 法: double ceil(double x);
功 能: 返回大于或者等于指定表达式的最小整数
头文件:math.h
说明:
float ceil ( float value )
返回不小于 value 的下一个整数,value 如果有小数部分则进一位。ceil() 返回的类型仍然是 float,因为 float 值的范围通常比 integer 要大。
#include<stdio.h>
#include<math.h>
intmain(void)
{
double number=123.54;
double down,up;
down=floor(number);
up=ceil(number);
printf("originalnumber%5.2lf\n",number);
printf("numberroundeddown%5.2lf\n",down);
printf("numberroundedup%5.2lf\n",up);
return0;
}
运行结果:
originalnumber123.54
numberroundeddown123.00
功 能: 返回大于或者等于指定表达式的最小整数
头文件:math.h
说明:
float ceil ( float value )
返回不小于 value 的下一个整数,value 如果有小数部分则进一位。ceil() 返回的类型仍然是 float,因为 float 值的范围通常比 integer 要大。
#include<stdio.h>
#include<math.h>
intmain(void)
{
double number=123.54;
double down,up;
down=floor(number);
up=ceil(number);
printf("originalnumber%5.2lf\n",number);
printf("numberroundeddown%5.2lf\n",down);
printf("numberroundedup%5.2lf\n",up);
return0;
}
运行结果:
originalnumber123.54
numberroundeddown123.00
numberroundedup124.00
oc中例子:
CGFloat ceilCount = ceil((images.count+1)/num);
0 0
- ceil
- ceil
- ceil
- ceil
- ceil函数
- ceil () 函数
- absolute ceil
- ceil 函数
- ceil函数
- Ceil函数
- Math.ceil
- ceil、floor
- ceil函数
- lua math.ceil math.ceil
- floor(),ceil()函数
- ceil floor round
- floor函数,ceil函数
- JS中 Math.ceil
- 串口通信概念基础
- oracle 导出指定表
- HTML5表单属性(四)
- lambda表达式的的两个内置函数的用法
- 关于意义这个东西
- ceil
- ผลบอล บุนเดสลีกา เยอรมัน
- iOS自适应布局之Masonry(一)
- Java中List集合的四中遍历方式
- jQuery.noConflict() 兼容其他插件的方法
- Django表单API
- (九)RxJava:RxBus
- operator is not allowed for source level below 1.7
- linux zip/unzip命令