Division by zero: Undefined Behavior or Implementation Defined in C and/or C++?

I don’t see any contradiction. Division by zero is undefined, period. There is no mention of “… unless INFINITY is defined” anywhere in the quoted text.

Note that nowhere in mathematics it is defined that 1 / 0 = infinity. One might interpret it that way, but it is a personal, “shortcut” style interpretation, rather than a sound fact.

Leave a Comment