java math常用函数
2017-01-29 18:31
267 查看
package com.releed.hellojava; public class HelloJava { //类名首字母一般大写 public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("10+5="+(10+5)); System.out.println("10-5="+(10-5)); System.out.println("10*5="+10*5); System.out.println("10/3="+10.0/3); System.out.println("10/3="+Math.floor(10.0/3)); System.out.println("3.75四舍五入="+Math.round(3.75)); System.out.println("3.75四舍五入保留一位小数="+Math.round(3.75*10)/10.0); //3.75*10为37.5 round四舍五入后为38 //之后结果再/10.0=3.8 System.out.println("|-10|="+Math.abs(-10)); System.out.println("2的8次方="+Math.pow(2, 8)); System.out.println("100的平方根="+Math.sqrt(100)); } }
相关文章推荐
- java常用函数之math
- java math 常用函数【自己留存】
- java常用函数之math
- 【java.math.BigInteger】常用函数
- java中Math常用的数学函数
- Java中Math的常用函数
- JAVA常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数
- math.h中一些常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数
- java——自写的常用函数
- JAVA常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数
- java中关于时间日期操作的常用函数