On Numbers
Erik Max Francis
max at alcyone.com
Mon Jan 16 21:53:43 EST 2006
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.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Walk into a room and make the / Whole interior inferior
-- Ice Cube
More information about the Python-list
mailing list