[EMAIL PROTECTED] wrote:
> Does anyone know of an approximation to raising a negative base to a
> fractional exponent? For example, (-3)^-4.11111 since this cannot be
> computed without using imaginary numbers. Any help is appreciated.

As others have said, you can use Python's complex numbers (just write -3 
as -3+0j).  If for some reason you don't want to, you can do it all with 
reals using Euler's formula,

(-3)^-4.11111  =  (-1)^-4.11111  *  3^-4.11111
=
e^(j*pi*-4.11111)  *  3^-4.11111
=
(cos(pi*-4.11111) + j*sin(pi*-4.11111)) * 3^-4.11111

in Python:

 >>> import math
 >>> real_part = (3**-4.11111) * math.cos(-4.11111 * math.pi)
 >>> imaj_part = (3**-4.11111) * math.sin(-4.11111 * math.pi)
 >>> (real_part,imaj_part)
(0.01026806021211755, -0.0037372276904401318)


Ken
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to