Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- ruby2d
- IntelliJ
- react
- maven
- CPP
- Vane
- ruby
- Android
- RaspberryPi
- boj
- Java
- rubymine
- GitHub
- C
- jetbrains
- gnuplot
- kotlin
- Godot
- 루비
- plugin
- 개발노트
- OAuth
- Spring
- gradle
- error
- Python
- Shell
- OTLanguage
- JS
- Baekjoon
Archives
- Today
- Total
목록BigDecimal (1)
PersesTitan(페르) 기술블로그
[Java] Non-terminating decimal expansion; no exact representable decimal result.
Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result. at java.base/java.math.BigDecimal.divide(BigDecimal.java:1766) at Main.main(Main.java:14) 코드 에러가 발생한 코드 예시 BigDecimal b1 = new BigDecimal("155.2"); BigDecimal b2 = new BigDecimal("0.3"); System.out.println(b1.divide(b2)); 원인 BigDecimal는 정확한 계산이 가능하지만 나누기와 같은 소수점 계산을..
Error
2023. 1. 21. 13:19