expected output from log of negative number
avraham rosenberg
for.avraham at gmail.com
Fri Jun 13 22:05:50 CDT 2008
On Fri, Jun 13, 2008 at 9:40 PM, E. Joshua Rigler <relgire at gmail.com> wrote:
> If I type log10(-1), I get a complex number back whose real part is the
> log of the absolute value of the argument, and whose imaginary part is
> always equal to 1.36438. What's more, I get similar behavior with a
> natural log, but the imaginary part is always equal to Pi.
>
> I've managed to confirm that this behavior is compatible with ML, so I
> imagine it's not a bug, but can someone explain to me the logic here?
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
Look at a real number in the complex plane. It is a vector on the x (real)
axis. On the positive direction, if it is positive and on the negative
direction ( at an angle of pi with the positive direction), if it's
negative. Its exponential representation will be, therefore
a=abs(a) * exp(0), for all positive reals and b=abs(b) * exp(pi) for all
negative reals.
Now, take the logarithm...
Cheers, Avraham
--
please do not sent powerpoint attachments to this address
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080614/dabe6f9f/attachment.html
More information about the Help-octave
mailing list