In general, a floating point exception is an example of the more general class of exceptions. The specifics will vary from machine to machine.
There are a number of things that can "kill" your program, and all of these can be classified as exceptions in this regard:
- access to nonexistent memory
- improper access to memory (misaligned, write to read-only, etc.)
- divide by 0
- illegal instruction
- resource limit exceeded (e.g. CPU time)
- arithmetic overflow
Under Unix-like operating systems, access to nonexistent memory is typically a "segmentation violation", while improper access to memory is typically a "bus error". (Under Windows they are/were a General Protection Violation, and/or a BSOD.)
And as you can see, although dividing by 0 is an exception, it's a sibling of a segmentation violation, not a subset.
(I've listed arithmetic overflow as an exception because it could be, not because it usually is. Most of today's systems do not treat overflow as an exception, of course. But by the rules of C they could, with the exception of overflows on unsigned integers, which are required by C to be defined and well-behaved.)
Under Unix-like operating systems, most/all of these exceptions tend to be mapped to signals, which your program can catch so that it can (attempt to) continue rather than dying.
(Ironically, on the system where I just tried it, integer divide-by-0 gives me a "floating point exception", while a floating-point divide-by-0 gives me an IEEE-754 inf
, which is not an exception at all. But that's a different question.)