Add portable isNan() and isInf()

+ Fix #166