On 2012-Dec-22 23:38 , Programmingkid wrote:
I also like still allowing internal C divisions to invoke the processor divide by zero traps, as it's very useful at pointing out when you've forgotten to set something rather than carrying on with an erroneus result. Do people think this is an acceptable solution?
What if someone made their program knowing that division by zero is equal to zero? This is the behavior that Apple's Open Firmware follows. I think we should follow it for the PowerPC target.
That would be incorrect, by all standards. Indeed, Solaris uses divide by zero as a fatal error indicator during the boot process, knowing it will trap.