3 ms·
Did you notice that the check of divisor being zero happens after the division, not before? It's undefined behavior because the behavior cannot be defined. On I
by kccqzy 2y ago
Did you notice that the check of divisor being zero happens after the division, not before? It's undefined behavior because the behavior cannot be defined. On Intel you get a #DE before you do the check; this behavior cannot be standardized and that's why it's UB.