Three types of special floating point value

        try {
            double a = 1d/0d;
        } catch (Exception e) {
                System.out.println("eeeee");
        }finally {
            System.out.println("ffff");
        }
The results 
ffff

 

In JAVA Numerical three types of special floating point: positive infinity (Infinity), negative infinity (-Infinity), NaN

these three values is used to indicate an error or overflow situation. But not reported abnormal!

In integer arithmetic, the divisor is not 0, otherwise run directly exceptions. But in the floating-point operations, the introduction of the concept of infinity.

Guess you like

Origin www.cnblogs.com/wskb/p/10958852.html
Recommended