Re: ELF detector
From: Spehro Pefhany (speffSNIP_at_interlogDOTyou.knowwhat)
Date: 09/26/04
- Next message: Chaos Master: "Re: ELF detector"
- Previous message: John Woodgate: "Re: ELF detector"
- In reply to: John Woodgate: "Re: ELF detector"
- Next in thread: Chaos Master: "Re: ELF detector"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 26 Sep 2004 13:19:06 GMT
On Sun, 26 Sep 2004 09:38:15 +0100, the renowned John Woodgate
<jmw@jmwa.demon.contraspam.yuk> wrote:
>I read in sci.electronics.design that Ed Price <edprice@cox.net> wrote
>(in <q0v5d.74623$9Y5.54225@fed1read02>) about 'ELF detector', on Sun, 26
>Sep 2004:
>>
>>"John Woodgate" <jmw@jmwa.demon.contraspam.yuk> wrote in message
>>news:bkJTvRCl5mVBFwXa@jmwa.demon.co.uk...
>>>I read in sci.electronics.design that Ken Smith
>>> <kensmith@green.rahul.net> wrote (in <cj4o62$g7l$8@blue.rahul.net>)
>>> about 'ELF detector', on Sat, 25 Sep 2004:
>>>
>>>>I doubt software can do it. You need to divide by zero. Most
>>>>programmers have a hard time writing code that does that successfully.
>>>
>>> IF DIVISOR = 0, THEN RESULT = 1E+38 ELSE RESULT = DIVIDEND/DIVISOR
>>>
>>> It's the order in which you write it that matters. (;-)
>>> --
>>> Regards, John Woodgate, OOO - Own Opinions Only.
>>> The good news is that nothing is compulsory.
>>> The bad news is that everything is prohibited.
>>> http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
>>
>>
>>Precisely, solved in Basic, circa 1968!
>>Or in Fortran, even earlier!
>>That's how coders solve those pesky little "special cases". <g>
>>
>There's a bit more to it. My pseudocode produces an extreme outlier
>result, which the user really ought to pick up. It does NOT produce an
>error message that stops the program. Of course it can be extended to
>produce a *warning*. Stopping the program for a recoverable error is,
>IMHO, really rather stupid.
Note that you've arbitrarily chosen to use a very large positive
number for the result, even if the dividend is negative. I prefer math
that saturates in the appropriate direction. Sometimes, even with
division by zero errors, you can get it right. The sign tends to
matter quite a bit in control stuff.
Best regards,
Spehro Pefhany
-- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
- Next message: Chaos Master: "Re: ELF detector"
- Previous message: John Woodgate: "Re: ELF detector"
- In reply to: John Woodgate: "Re: ELF detector"
- Next in thread: Chaos Master: "Re: ELF detector"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|