Why does integer division by zero 1/0 give error but floating point 1/0.0 returns “Inf”?

That’s because integers don’t have values for +/-Inf, NaN, and don’t allow division by 0, while floats do have those special values.

Leave a Comment