카테고리 없음
JAVA Lang
sunghyun1200
2017. 5. 26. 00:15
돈관련 연산 수행시
정수형 = BigInteger
소수형 = BigDecimal 사용
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | package Test3; public class lang { public static void main(String[] args){ lang sample = new lang(); sample.integerMinMaxCheck(); } public void integerMinMaxCheck(){ String max =Integer.toBinaryString(Integer.MAX_VALUE); String min =Integer.toBinaryString(Integer.MIN_VALUE); System.out.println(max); System.out.println(min); } } | cs |
결과
max: 1111111111111111111111111111111
min : 10000000000000000000000000000000