[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

**To**:**Taylor R Campbell <campbell+netbsd%mumble.net@localhost>****Subject**:**Re: standards on SIGFPE for divide by zero****From**:**Matt Thomas <jabbathespud%gmail.com@localhost>**- Date: Tue, 1 Mar 2011 13:41:24 -0800

On Mar 1, 2011, at 11:00 AM, Taylor R Campbell wrote: > Correctly signalling SIGFPE for integer division by zero is important. > > Integer division by zero is a bug. Robust, safe programming language > environments such as Emacs and Java need to report such bugs without > crashing: there is nothing that it is OK for (/ x 0) to return in > elisp, and it's also not OK for Emacs to crash -- you should get a > debugger if you want, and continue with your editing unharmed, unless > the division happens deep inside some critical path of Emacs. It may > be OK in elisp to check every integer division for a divisor of zero, > but that's not OK in fast systems, which rely on handling SIGFPE to > report the error. PowerPC cann't raise an exception on integer divide by zero. It can detect it if using the divwo instruction but it still won't raise an exception. Instead you need to check the OV bit in the XER register.

**Follow-Ups**:**Re: standards on SIGFPE for divide by zero***From:*Taylor R Campbell

**Re: standards on SIGFPE for divide by zero***From:*Jeff Rizzo

**References**:**standards on SIGFPE for divide by zero***From:*Taylor R Campbell

- Prev by Date:
**standards on SIGFPE for divide by zero** - Next by Date:
**Re: standards on SIGFPE for divide by zero** - Previous by Thread:
**standards on SIGFPE for divide by zero** - Next by Thread:
**Re: standards on SIGFPE for divide by zero** - Indexes: