java.lang.Double.isInfinite()


java.lang.Double.isInfinite()

package com.codingdict;



import java.lang.*;



public class DoubleDemo {



   public static void main(String[] args) {



      Double d1 = new Double(1.0/0.0);

      Double d2 = new Double(0.0/0.0);



      // returns true if positive or negative infinity

      System.out.println(d1 + " = " + d1.isInfinite());



      // returns false for other cases

      System.out.println(d2 + " = " + d2.isInfinite());

   }

}