When you go to normalize the gain of the induction loop at zero Hz, you have to write some very tricky software. You have to divide by zero to get any sensitivity you want. Most programmers would have trouble designing a divide by zero routine that is accurate to more than 1 bit.
You could use a GMR or other magnetoresistive device.
--
kensmith@rahul.net forging knowledge
Didn't find your answer? Ask the community — no account required.
Would yeld a different result but you haven't successfully divided by zero since the logic of your code avoids the divide completely if the DIVISOR is zero.
There is a trick you can use in C++ to do it. C++ allows all operators to be overloaded. Thus in C++ you can make up you own rules about ADD, SUBTRACT, MULTIPLY and DIVIDE to that 1/0 is perfectly legal.
In C++ you can make the main part of your program:
int main(void){ return 1/0; }
--
kensmith@rahul.net forging knowledge
J
John Woodgate
I read in sci.electronics.design that Ken Smith wrote (in ) about 'ELF detector', on Sun, 26 Sep 2004:
Perfectly valid code in HSILGNE.
of course, because N/0 is mathematically nonsense, so it *can't* be evaluated rigorously.
Is that essentially different from my pre-emptive *redefinition* of N/0 as '= 1E38'?
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
K
Ken Smith
[...]
A few differences:
(1) What you showed could be figured out by the maintainers. The C++ version can easily be written so that no-one can understand it.
(B) The version you did is discontinuous near zero. In C++ you can redefine the divide so that X/Y cos(X/Y) yelding a nice smooth curve near zero.
(iii) The 1E38 is machine dependant.
(d) C++ is coded in lower case.
--
kensmith@rahul.net forging knowledge
R
Robert Baer
Reply to option (d): That is because the programmers are too damn lazy to use mixed case.
J
John Woodgate
I read in sci.electronics.design that Ken Smith wrote (in ) about 'ELF detector', on Sun, 26 Sep 2004:
I agree that is the whole justification for the use of C++ for anything.
But you often don't want to *disguise* the 'divide by zero' because it indicates a problem further up the code. Also, how can replacing, say,
136/0 by cos(136/0) = ?? make a smooth curve when the adjacent points are cos(135/0.001) = 0.87 and cos(137/-0.003) = 0.89?
So, replace by the outlier of your choice (or the one dictated by your genes and memes).
Oh, well, you're obviously completely right, then. That's an
*****ESSENTIAL**** difference.
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
M
Mike Monett
[...]
Ken, my math is shaky at best, especially near infinity. Wouldn't cos(X/Y) give an infinite number of zero crossings as X0 and Y-->0?
Best Wishes,
Mike Monett
K
Ken Smith
[...]
You are right. I messed up. I should have written something like cos(X+Y)
The whole point of C++ is information hiding isn't it? You want to hide as much information as you can spread over about 50 *.h files so the maintainer has no hope of finding the bugs.
This is part of the reason why there is much more code reuse in the Fortran community than the C++ one.
--
kensmith@rahul.net forging knowledge
K
Ken Smith
Your seems to be better than mine were at that moment in time. Yes I messed up on that one.
--
kensmith@rahul.net forging knowledge
J
Jamie
just need a fraction byte :)
Ken Smith wrote:
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.