Liste des Groupes | Revenir à cl c |
On 4/27/25 9:33 AM, Bonita Montero wrote: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.
NO, not all processors have a trap for divide by zero on integers, and
many that do allow the disabling of that trap.
The results of the divide are just declaired to be undefined (but their
is likely some definite result that will happen due to the division
algorithm being performed).
Les messages affichés proviennent d'usenet.