Java tutorial
//package com.java2s; public class Main { /** * Returns true if the number is not NaN or infinite. * @param d * @return */ public static boolean isReal(double d) { return !Double.isNaN(d) && !Double.isInfinite(d); } }