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

**To**:**Jeff Rizzo <riz%tastylime.net@localhost>****Subject**:**standards on SIGFPE for divide by zero****From**:**Taylor R Campbell <campbell+netbsd%mumble.net@localhost>**- Date: Tue, 1 Mar 2011 19:00:31 +0000

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. Floating-point division by zero is a slightly fuzzier business -- there are values it is OK to yield, for instance -- so I sha'n't opine on it here.

**Follow-Ups**:**Re: standards on SIGFPE for divide by zero***From:*Matt Thomas

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

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