头文件: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
先用一个变量存储这个数假设是num再把<%=Math.ceil(1.002)%>改一下<%
dim sz
sz=52.001
if(sz>cint(sz)) then
Response.write(Cstr(Cint(sz+1)))
else
Response.write(Cstr(cint(sz)))
end if
%>
select ceil(7.2) as cc from dualcc
------
8
################################
In Oracle/PLSQL, the ceil function returns the smallest integer value that is greater than or equal to a number.
The syntax for the ceil function is:
ceil( number )
number is the value used to find the smallest integer value.
Applies To:
Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For Example:
ceil(32.65) would return 33.
ceil(32) would return 32.
ceil(-32.65) would return -32.
ceil(-32) would return -32.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)