Support inf, -inf and NaN for floats.