Java round() 方法
Java 教程
· 2019-02-08 12:28:32
round() 方法返回一个最接近的int、long型值。
语法
该方法有以下几种语法格式:
long round(double d) int round(float f)
参数
d -- double 或 float 的原生数据类型
f -- float 原生数据类型
返回值
返回一个最接近的int、long型值,方法会指定返回的数据类型。
实例
实例
public class Test{
public static void main(String args[]){
double d = 100.675;
double e = 100.500;
float f = 100;
float g = 90f;
System.out.println(Math.round(d));
System.out.println(Math.round(e));
System.out.println(Math.round(f));
System.out.println(Math.round(g));
}
}
编译以上程序,输出结果为:
101 101 100 90
点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html
深入Linux内核架构
Wolfgang Mauerer / 郭旭 / 人民邮电出版社 / 201005 / 149.00元
众所周知,Linux操作系统的源代码复杂、文档少,对程序员的要求高,要想看懂这些代码并不是一件容易事。本书结合内核版本2.6.24源代码中最关键的部分,深入讨论Linux内核的概念、结构和实现。具体包括进程管理和调度、虚拟内存、进程间通信、设备驱动程序、虚拟文件系统、网络、时间管理、数据同步等方面的内容。本书引导你阅读内核源代码,熟悉Linux所有的内在工作机理,充分展现Linux系统的魅力。 ......一起来看看 《深入Linux内核架构》 这本书的介绍吧!