On Numbers

Tom Anderson twic at urchin.earth.li
Wed Jan 18 00:34:40 CET 2006


On Mon, 16 Jan 2006, Erik Max Francis wrote:

> Steven D'Aprano wrote:
>
>> The square root of 1 is +1 (the negative root being explicitly 
>> rejected). Pure mathematicians, who may be expected to care whether the 
>> root is the integer 1 or the real number 1, are unlikely to write 
>> 1**0.5, prefering the squareroot symbol.
>> 
>> For the rest of us, including applied mathematicians, 1**0.5 implies 
>> floating point, which implies the correct answer is 1.0.
>> 
>> So I don't really know what point you are making. What solution(s) for 
>> 1**0.5 were you expecting?
>
> He's probably getting at the fact that if you're dealing with complex 
> numbers, square root get a lot more complicated:
>
> 	http://mathworld.wolfram.com/SquareRoot.html
>
> But still, that doesn't change the fact that x**0.5 as is meant here is 
> the principal (positive) real square root, and that can be true whether 
> your hierarchy of numeric types includes a complex type or not.

Er, actually, i meant to write -1, but evidently missed a key, and failed 
to check what i'd written.

But excellent discussion there, chaps! All shall have medals!

tom

-- 
Taking care of business



More information about the Python-list mailing list