Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: LibWhacker
"Imagine you're landing on an aeroplane and the automatic pilot's working," he suggests. "If it divides by zero and the computer stops working - you're in big trouble. If your heart pacemaker divides by zero, you're dead."

Unless your code has...oh, I don't know...EXCEPTION HANDLING?!

What a waste of education.

27 posted on 12/08/2006 12:34:38 PM PST by Slings and Arrows ("Nancy [Pelosi] was voted the Number one reason why men in San Francisco are homosexuals."-Wikiality)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: Slings and Arrows

Unless your code has...oh, I don't know...EXCEPTION HANDLING?!

Now that's funny right there, I don't care who ya are.


47 posted on 12/08/2006 12:45:57 PM PST by 2 Kool 2 Be 4-Gotten
[ Post Reply | Private Reply | To 27 | View Replies ]

To: Slings and Arrows

The funny part is, if you divided by zero, usually the problem was getting a zero to divide with, not the fact that you want to use it in the division.

So allowing the calculation to proceed isn't helpful, what you might want to do is go back and figure out why you got a zero to begin with.

In signal processing code, they often use the NaN for this and keep going if that's what is necessary. This isn't a new concept.


56 posted on 12/08/2006 12:50:06 PM PST by CharlesWayneCT
[ Post Reply | Private Reply | To 27 | View Replies ]

To: Slings and Arrows

When I was writing accounting software, one of the areas I had to foresee was dividing by zero. The Windows core routines will 'throw an exception' when encountering a divide-by-zero. The software program must 'catch' the 'thrown exception' and handle it in some way. I wrote elaborate error functions to catch every error we could think of, but of course, some user would always manage within 30 seconds to do something stupid. However, almost all modern software handles divide-by-zero problems gracefully.


84 posted on 12/08/2006 1:01:36 PM PST by gb63
[ Post Reply | Private Reply | To 27 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson