Use Double/Float.compare for NaN/Infinity handle