What's the type of of the expression? 1 div 0 (integer division) is indeed a EDivByZero exception, but 1 / 0 (floating point) is not. It leads to infinity as what you get.
If it departed from Delphi for all 3 operating systems, then maybe yes. But it seems like it departs from Delphi only for OSX.
Hm... I don't know how to read this. Infinity is not a numerical value, so division by 0 is a mathematical impossibility. Why complicate matters?
CPU floating point units do indeed define infinity, as +Inf and -Inf IIRC. They can also return NaN. It is therefore logical that software floating point operations that use the FPU do the same.
I can't see why you'd ever not want to raise an exception. The IEEE discussions about some calculations that can survive a divide-by-zero error and should be allowed to proceed seems like total nonsense to me.
That's funny... So, CPU makers have decided to reinvent mathematics. If one were to follow this line of reasoning then, for x = 0 (1/x = Inf) => (2/x = 2*Inf) As Inf > 0 it is "obvious" that 2*Inf > InfHow further can one push this... logic?
8.5 X87 FPU FLOATING-POINT EXCEPTION CONDITIONS8.5.3 Divide-By-Zero Exception (#Z)When a divide-by-zero exception occurs and the exception is masked, the x87 FPUsets the ZE flag and returns the values shown in Table 8-10. If the divide-by-zeroexception is not masked, the ZE flag is set, a software exception handler is invoked(see Section 8.7, “Handling x87 FPU Exceptions in Software”), and the top-of-stackpointer (TOP) and source operands remain unchanged.
implementation uses math; ..initialization {$I unit1.lrs} SetExceptionMask(GetExceptionMask-[ExZeroDivide]);finalization SetExceptionMask(GetExceptionMask+[ExZeroDivide]);end.
In the case of Intel, I don't think so. They offer both the NaN and exception-raising approaches. This is from the Intel® 64 and IA-32 Architectures, Software Developer’s Manual Volume 1:Basic Architecture: