Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / What does -1.#IND mean?

Author
Message
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 5th Aug 2004 23:57
I was just trying to run the code sent to me via Ric and my logarithmic slider problem and the editor is complaining of;

Warning in line 40: Cannot divide by zero.

The code being run is;


and it complains about the term (lga#*lnb#). When I try to print the value of lga# in the CLI is get the response of -1.#IND.

When I trace it back to log# I get the same response.

So, what the heck?
Thanks.
S.

Any truly great code should be indisguishable from magic.
Calculus
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: Earth
Posted: 6th Aug 2004 06:46
IND = Indeterminate (The input to the variables probably causes the equation to evaluate to infinity or a division by zero in which case can never be truly displayed as the number is infinitely large).
1/0 = infinity. -1/0 = -infinity.

I think your function works quite well with the exception of entering negative numbers which will always produce a mathematical error as this can only be solved in the imaginary plane.
sqrt(-1)=i or j.

The DBC solution to ric's code is in your other thread.

I have exchanged my function with yours to show a slide rule.

If you align the top slide number 2, over bottom slide number 1, it will give you the 2 times table. Also if you align top slide number 3, over bottom slide number 1, it gives you the 3 times table.

P.s. It may run slowly because of the number of line commands used.



Kind Regards
Calculus
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 6th Aug 2004 14:01
Thanks Calculus,

And yeah, I was able to figue that out having checked the value being passed to log() and finding it was negative. Made the additional tag of "#IND" self explanatory then.

I'll look at your code in a little bit, then see if it meets my needs. Thanks again.
S.

Any truly great code should be indisguishable from magic.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 6th Aug 2004 20:46
Great! Marvelous! Wonderful!

Thanks Calculus, that's exactly what I needed. I knew it was a matter of having the proper formula, now you've given it to me. I should point out however that it also shows up a slight percentage of error, as in trying to use the slide rule to multiply 2 by the sacle. 4 doesn't quite line up, 3-6 does, 4-8 does, 5-10 doesn't etc. And the fine upper marks are a little "uneven," but they are close enough for my purposes. (I tried increasing the resolution of the log routine and it helped a little, but not enough to really make a difference.)

And where I appreciate the extra data about multiplying and finding roots and such, I really didn't need it.

Thanks so much... it was driving me insane.

(Btw; love the way you made it into a visual slide rule too. That was fun.)

S.

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2024-11-27 04:52:54
Your offset time is: 2024-11-27 04:52:54