On Thu, Jul 24, 2008 at 10:17 PM, John Fouhy <[EMAIL PROTECTED]> wrote:
> On 25/07/2008, Sam Last Name <[EMAIL PROTECTED]> wrote:
>>
>> Traceback (most recent call last):
>>   File "C:\Python\Script2.py", line 4, in <module>
>>     print -b + [((b*b - 4*a*c)**0.5)/(2*a)]
>> ValueError: negative number cannot be raised to a fractional power
>
> This is normal; if you want to handle complex numbers you will need to
> do a lot more work..

The sqrt() function in the cmath module will compute complex square roots.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to