소수점 이하 버리기 WA 이유를 알고싶어요

SehongPark Reply 7 years 28 weeks ago
public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.printf("%.1f\n", (int) (area * 10) / 10.0); System.out.printf("%.1f\n", (int) (volume * 10) / 10.0); } }
SehongPark Reply 7 years 28 weeks ago
아 캐스팅하면서 오버플로우 나는구나.. 죄송 자답입니다