package com.swift;

public class Math_Round {

    public static void main(String[] args) {
/*
* Math round为+0.5后的floor(也可以说正数四舍五入负数五舍六入) ceil天花板 floor地板
*/ System.out.println(Math.round(11.4));
System.out.println(Math.round(11.5));
System.out.println(Math.round(11.6));
System.out.println(Math.round(-11.4));//-11.4+0.5=-10.9 取floor为-11
System.out.println(Math.round(-11.5));//-11.5+0.5=-11 取floor为-11
System.out.println(Math.round(-11.6));//-11.6+0.5=-11.1 取floor 为-12
} }

最新文章

  1. 条件注释判断浏览器版本<!--[if lt IE 9]>
  2. 项目管理工具之Git使用说明
  3. dw添加emmet
  4. ububtu 14.04 问题集合
  5. laravel项目拉取下来安装,node.js库安装
  6. NEUQ1051: 谭浩强C语言(第三版)习题6.7
  7. 【二十四】使用mysqli扩展类批量执行多条sql语句
  8. 在Linux上搭建测试环境常用命令(转自-测试小柚子)
  9. Web程序报错:Error instantiating servlet
  10. C# 枚举转列表
  11. keepalived+lvs子网掩码造成VIP切换故障 + vrrp_script+track_script
  12. c++创建二维动态数组与内存释放
  13. CENTOS7更换YUM源为163源
  14. 题外话:我想立刻辞职,然后闭关学习编程语言,我给自己3个月时间学习C语言!这样行的通吗
  15. Web 应用性能提升的 10 个建议
  16. MySQL小误区:关于set global sql_slave_skip_counter=N 命令的一些点
  17. 【模拟】Gym - 101190A - Abbreviation
  18. QT Creator常用快捷键
  19. 【强连通分量缩点】【记忆化搜索】bzoj1589 [Usaco2008 Dec]Trick or Treat on the Farm 采集糖果
  20. POJ1363 Rails 验证出栈序列问题

热门文章

  1. 牛客 PUBG
  2. sql 存储过程-proc
  3. postgresql删除还有活动连接的数据库
  4. Git把旧仓库的分支拉到新仓库中
  5. Unity Download Assistant Error: 'SendRequest Error' while downloading ini file from http://files.unity3d.com/bootstrapper/29055738eb78/unity-5.3.6f1-win.ini
  6. css盒子模型 css3盒子相关样式
  7. 1 误删dbf文件造成ORA-01109: 数据库未打开.
  8. 子元素的margin-top会影响父元素
  9. 一、基础知识 React API 一览
  10. cf314E. Sereja and Squares(dp)