Sujet : Re: integer divided by zero
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.cDate : 27. Apr 2025, 14:33:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vulbmd$t4di$1@raubtier-asyl.eternal-september.org>
References : 1
User-Agent : Mozilla Thunderbird
Am 25.04.2025 um 19:38 schrieb Thiago Adams:
Does anyone know of any platform where integer division by zero returns a number, or in other words, where it's not treated as an error? I'm asking because division by zero is undefined behaviour, but I think division by a constant zero should be a constraint instead.
I guess the trap is induced on all platforms since there's no binary
representation for +/-inf with integrals.
The platform with the most comfortable handling of division by zeroes
is Windows. Win32 allows to catch that errors easily, whereas with
Posix it's hard to continue the code in the same function or with
a calling function.