package math;
/**
* 3 + 2 ÷ 0 = ?
*
* 低阶数学,这个是没有意义的
* 高等数学,2 ÷ 0 = ∞,因为2里面包含无数个0的意思
*
* ----------------------------
* 计算机
* Integer也是不可以除的会出Exception in thread "main" java.lang.ArithmeticException: / by zero
* Double是可以除的会等于一个叫Infinity无穷大的意思
*
* @author ZengWenFeng
* @date 2022.10.25
*/
public class Math_Infinity
{
public static void main(String[] args)
{
//System.out.println(1 / 0);//Exception in thread "main" java.lang.ArithmeticException: / by zero
System.out.println(1.0 / 0);//Infinity
System.out.println(-1.0 / 0);//-Infinity
System.out.println(0.0 / 0);//NaN
//System.out.println(3 + 2 / 0);//Exception in thread "main" java.lang.ArithmeticException: / by zero
System.out.println(3.0 + 2.0 / 0);//Infinity
}
}
