package com.Lucky.OftenClass; /* Math1类: */ public class MathCalss { public static void main(String[] args) { System.out.println(Math.PI); System.out.println(Math.max(1,5)); //最大值 System.out.println(Math.min(2,9)); //最小值 System.out.println(Math.pow(2,2)); //平方 System.out.println(Math.abs(-5)); //绝对值 System.out.println(Math.ceil(4.5)); //向上取整 System.out.println(Math.floor(4.5)); //向下取整 System.out.println(Math.round(4.5)); //四舍五入 System.out.println(Math.signum(14.5)); //正数返回1 System.out.println(Math.signum(-14.5)); //负数返回-1 System.out.println(Math.signum(0)); //0 System.out.println(Math.sqrt(25)); //开平方 } }
标签:4.5,常用,java,System,signum,println,Math,out From: https://www.cnblogs.com/Lucky-only/p/16922194.html