Java ceil() 方法
Java 教程
· 2019-02-08 11:42:53
ceil() 方法可对一个数进行上舍入,返回值大于或等于给定的参数。
语法
该方法有以下几种语法格式:
double ceil(double d) double ceil(float f)
参数
- double 或 float 的原生数据类型。
返回值
返回 double 类型,返回值大于或等于给定的参数。
实例
public class Test{
public static void main(String args[]){
double d = 100.675;
float f = -90;
System.out.println(Math.ceil(d));
System.out.println(Math.ceil(f));
System.out.println(Math.floor(d));
System.out.println(Math.floor(f));
}
}
编译以上程序,输出结果为:
101.0 -90.0 100.0 -90.0
点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html
Beginning XML with DOM and Ajax
Sas Jacobs / Apress / 2006-06-05 / USD 39.99
Don't waste time on 1,000-page tomes full of syntax; this book is all you need to get ahead in XML development. Renowned web developer Sas Jacobs presents an essential guide to XML. Beginning XML with......一起来看看 《Beginning XML with DOM and Ajax》 这本书的介绍吧!