Re: phpsadness

From: Date: Sun, 29 May 2011 18:56:47 +0000
Subject: Re: phpsadness
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-313228@lists.php.net to get a copy of this message
On 11-05-28 08:36 PM, TR Shaw wrote:
Well the argument has both sides. Division by zero on many platforms resulted in zero. Then came IBM360 and it generated an exception causing big time issues in legacy code so a OS patch was written to intercept the interrupt, jam the result to zero and return. Although mathematically undefined is correct, in most programtic cases zero is an acceptable and in fact a preferred result. (sorry for the top posting)
Personally, I prefer the exception. Logically, I can take 0 from something an infinite number of times... zero seems a far cry from this. To properly determine the intent of a division by zero, I think the programmer SHOULD have to handle it. Personally, I don't see 0 as acceptable. It suggests improper boundary checking. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.

« previous php.general (#313228) next »