Earlier quoted context omitted.
Why do you need exceptions at all? They’re just a different return types in disguise… Also, division by zero should return Inf
Division by zero is mathematically undefined. So two's complement integer division by zero is always undefined. For floating point there is the interesting property that 0 is signed due to its signed magnitude representation. Mathematically 0 is not signed but in floating point signed magnitude representation, "+0" is equivalent to lim x->0+ x and "-0" is equivalent to lim x->0- x. This is the only situation where a…
I think the most pragmatic solution is to have 2 tiers:
1. use existing standards (i.e. IEEE 754 for FP, de-facto standards for integers, like two's complement, Big-Endian, etc.)
2. fast, native format per each compute device, using different sub-types so you will not be able to mix them in the same expression