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.
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.
goldside000@outlook.com writes:
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.
Yes, I mentioned that in this thread more than a month ago. On two
Linux AARM64 systems I've tried, dividing an integer by zero in a >non-constant expression yields 0.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 11 |
Nodes: | 8 (0 / 8) |
Uptime: | 50:51:37 |
Calls: | 166 |
Files: | 21,502 |
Messages: | 77,738 |