x86 will deliver an exception on division by zero. This is fun in most *NIX systems because they will map it to SIGFPE and whether you get a trap or an unspecified result depends on the floating-point environment. But that’s not because it’s a good behaviour, it’s because C decided that they wanted to map the / operator to a single instruction on any platform that had a divide instruction. And then other languages wanted to be ‘as fast as C’, so picked up this behaviour.

— david_chisnall, Lobsters