Re: how different system respond to ln(0) vs ln(0.0)



Just another view w/ Mathematica:

An Approximate 0.0 covers a very small interval.

x = Interval[0.0]

Interval[{-2.2250738585072014*^-308,
2.2250738585072014*^-308}]

{Min[x], Max[x]}

{-2.2250738585072014*^-308,
2.2250738585072014*^-308}

The value a hair smaller than 0 is Complex, and a value a hair larger than
zero is Real.
Log[%]

{-708.3964185322641 + 3.141592653589793*I,
-708.3964185322641}

Hence...

Log[0.0]
Indeterminate

--
Dana DeLouis
Mathematica 5.2

"Nasser Abbasi" <nma@xxxxxxxxx> wrote in message
news:nJDIh.32$p17.2@xxxxxxxxxxxxxxx
Do these responses make sense? Why is ln(0) different from ln(0.0) ? I
assume since in one case, 0 is numeric, different path is used in the
code. But from a user point of view, ln(0) and ln(0.0) should give the
same result.

Any thoughts?

MAPLE:
======
restart;
ln(0.0);
-Float(infinity);

restart;
ln(0);
Error, (in ln) numeric exception: division by zero

Mathematica
==========
Log[0]
-Infiniy

Log[0.0]
Indeterminate

Matlab
=====
log(0)
Warning: Log of zero.

ans =

-Inf


Nasser




.



Relevant Pages