Correct handling of +-Inf.