java.lang.Double.isInfinite(double v) java.lang.Double.isInfinite() java.lang.Double.isNan() java.lang.Double.isInfinite(double v) 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(d1)); // returns false for other cases System.out.println(d2 + " = " + d2.isInfinite(d2)); } } java.lang.Double.isInfinite() java.lang.Double.isNan()