JAVA/자바

자바 반올림,소수점 버리기

왕왕왕왕 2015. 6. 28. 14:11

        // 반올림

// 101

System.out.println(Math.round(100.54));


// 100

System.out.println(Math.round(100.44));


//버림

//100.0

System.out.println(Math.floor(100.163));


  // 절대값

// 100.56

System.out.println(Math.abs(-100.56));