Re: Divide By Zero error [message #27932 is a reply to message #27878] |
Tue, 13 November 2001 17:57  |
Paul Manusiu
Messages: 8 Registered: October 2001
|
Junior Member |
|
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">
Yes, it was a rhetorical question. The reason why you can't take the log
of zero is simple. Best described by an example.
<br>given,
<br>y = 10 ^ x
<p>than,
<br>log_base_10 both sides gives
<p>log(y) = x
<p>if x = 0, than, in the first equation y = 1,
<p>if y = 0, x is not defined. (i.e. there is no power of 10
that can give you y = 0)
<p>Therefore, log (0) does not exist.
<p>As for what you do with zeros, I usually set a limit on my arrays.
<p>If array[i] less than limit,
<br>than array[i] equal limit.
<p>Usually I set limit equal to 10^(-6). But it depends on your array values.
Best thing to do is normalize array before setting limit, than scale back
to orginal values.
<p>You can use the "where" function for quick search of array.
<p>Cheers
<br>Paul M.
<p>Logan Lindquist wrote:
<blockquote TYPE=CITE><style></style>
<font face="Arial"><font size=-1>Paul,</font></font> <font face="Arial"><font size=-1>As
far as I know :) The log[base 10] of zero and the log[base 0] do not exist.
I am not qualified to give you an mathmatical rule or proof that proves
the reason behind this. I think of it as another of those rules in mathmatics
that are just because. I do think that it has something to do with how
logs [plural of the mathmatical term and not the wooden kind] describe
the curve of lines occuring in a coordinate system. Thus a zero would indicate
that no line exists.</font></font> <font face="Arial"><font size=-1>If
you question was meant to make me aware of the reason behind my error in
IDL, I thank you. I figured this out last week and now I am working on
a solution to solve it. Any suggestions to what I should do with the zero's
in my array would be helpful!</font></font> <font face="Arial"><font size=-1>Regards,</font></font> <font face="Arial"><font size=-1>Logan</font></font>
<blockquote
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">"Paul
Manusiu" <<a href="mailto:phpvm@alinga.newcastle.edu.au">phpvm@alinga.newcastle.edu.au</a>>
wrote in message <a href="news:3BEB6874.8305BCD@alinga.newcastle.edu.au">news:3BEB6874.8305BCD@alinga.newcastle.edu.au</a>...What
is the log of zero ??</blockquote>
</blockquote>
<p>--
<br> ------------------------------------------------------------ --
<br>Tapu'osi Paul Manusiu Loto'aniu & amp;nbsp;
Tel: +61 0249 215566
<br>CRC for Satellite Systems &am p;nbsp; &am p;nbsp;
Fax: +61 0249 216907
<br>Space Physics Group
<br>School of Mathematical and Physical Sciences
<br>University Of Newcastle, Australia
<br> ------------------------------------------------------------ --
<br>"The greatness of a nation and its moral progress can be judged
<br>by the way its animals are treated".
<br>- GANDHI
<br>
</body>
</html>
|
|
|