pow() works but sqrt() not!?

siggi smusnmrNOSPAM at yahoo.com
Thu Jan 4 17:00:33 CET 2007


Thanks for that, too!

Would be interesting to learn how these different algorithms influence the 
precision of the result!?



"Boris Borcic" <bborcic at gmail.com> schrieb im Newsbeitrag 
news:459d0a1c_6 at news.bluewin.ch...
> siggi wrote:
>> Hi all,
>>
>> this is a newbie question on :
>> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] 
>> on
>> win32
>> PC with WinXP
>>
>> In
>> http://www.python.org/doc/2.3.5/lib/module-math.html
>> I read:
>>
>> "sqrt( x) Return the square root of x."
>>
>> Now the test for module math with function pow():
>> ---------------------------------------------------
>>>>> pow(9,9)
>> 387420489
>>
>>  Fine, but sqrt() fails:
>> -------------------
>
> BTW note that (of course) you can write pow(x,.5) or x**.5 for sqrt(x)
> without any preliminary import statement 





More information about the Python-list mailing list