public class DoubleTest {
public static void main(String[] args) {
try {
double x = 64.0;
double y = 0.0;
System.out.println(x / y); // Infinity
System.out.println(x % y); // NaN
} catch (Exception e) {
System.out.println("Exception");
}
}
}
Double语法之除数为零
最新推荐文章于 2022-07-31 12:24:41 发布