| Deutsch English Français Italiano |
|
<vulbmd$t4di$1@raubtier-asyl.eternal-september.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero <Bonita.Montero@gmail.com> Newsgroups: comp.lang.c Subject: Re: integer divided by zero Date: Sun, 27 Apr 2025 15:33:44 +0200 Organization: A noiseless patient Spider Lines: 14 Message-ID: <vulbmd$t4di$1@raubtier-asyl.eternal-september.org> References: <vughb7$g6cm$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 27 Apr 2025 15:33:02 +0200 (CEST) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="a26d152f296efe3efb0524fbab183654"; logging-data="954802"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MhPG6rwQPuUNnBXsHPD2ctnG3wGJStKE=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:TNhJ4Q9DD0ZIZxpysYquA+gxmio= Content-Language: de-DE In-Reply-To: <vughb7$g6cm$1@dont-email.me> Bytes: 1772 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.