System.out.println((int) Math.floor(4.4497083717E10)); System.out.println((long) Math.floor(4.4497083717E10)); System.out.println((long) 4.4497083717E10); 2147483647 -- due to an overflow 44497083717 44497083717 |
a = 21413134219 b = 19241313142 sum = (long) (Double.parseDouble(a) + Double.parseDouble(b)); sum = 40654447361 |
참고사이트
1. Floor function to float and double values
2. Formatting troubles: How to power to number?
'알고리즘 > 기초정리' 카테고리의 다른 글
완전 탐색 알고리즘 (최근접 점쌍 문제) (0) | 2016.10.27 |
---|