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

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: CharlesWayneCT

LONG RESPONSE: That is exactly what I did when I encountered a Divide-by-zero error in some GPS code. The fix was to assume GPS was unavailable at that particular space-time instant, since the satellite positions resulted in a near-singular navigation matrix.

SHORT RESPONSE: If you're dividing by zero, the problem's probably buggered anyway.


73 posted on 12/08/2006 12:57:24 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 56 | View Replies ]

To: CharlesWayneCT
In signal processing code, they often use the NaN for this

Shouldn't that be NaNO2, decomposing to NaNO3? :-P

99 posted on 12/08/2006 1:08:16 PM PST by lepton ("It is useless to attempt to reason a man out of a thing he was never reasoned into"--Jonathan Swift)
[ Post Reply | Private Reply | To 56 | View Replies ]

To: CharlesWayneCT
In signal processing code, they often use the NaN for this

Shouldn't that be NaNO2, oxidizing to NaNO3? :-P

102 posted on 12/08/2006 1:08:57 PM PST by lepton ("It is useless to attempt to reason a man out of a thing he was never reasoned into"--Jonathan Swift)
[ Post Reply | Private Reply | To 56 | 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