Liste des Groupes | Revenir à cl c |
Am 25.04.2025 um 19:38 schrieb Thiago Adams:NO, not all processors have a trap for divide by zero on integers, and many that do allow the disabling of that trap.
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.
Les messages affichés proviennent d'usenet.