Sujet : Re: integer divided by zero
De : goldside000 (at) *nospam* outlook.com
Groupes : comp.lang.cDate : 31. May 2025, 19:56:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <101fjdd$1ct0s$1@dont-email.me>
References : 1
User-Agent : tin/2.6.4-20241224 ("Helmsdale") (Linux/6.14.6-arch1-1 (x86_64))
Thiago Adams <
thiago.adams@gmail.com> wrote:
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.
Yeah, I cannot think of an architecture where dividing by zero doesn't
result in an exception or error of some sort. But there's ARM, where it
might return 0, the dividend, or just garbage.