math.nroot [was Re: A brief question.]

Tom Anderson twic at urchin.earth.li
Mon Jul 4 10:32:04 EDT 2005


On Sun, 3 Jul 2005, Dennis Lee Bieber wrote:

> On Sun, 3 Jul 2005 20:53:22 +0100, Tom Anderson <twic at urchin.earth.li>
> declaimed the following in comp.lang.python:
>
>>    2
>> -1
>>
>> Evaluates to -1?
>
> 	But what do you expect, say
>
>   2
> -X
>
> to evaluate as? (-X)^2 or -(X^2)
>
> 	I'd expect the latter...

I think you've got me there.

> I see the problem here as an assumption that "-1" is an entity in its 
> own right, and not an operation of negating a "1", whereas "-X" is the 
> entity "X" being negated.

I think you're entirely correct. I'm not entirely sure that that 
assumption is wrong, but never mind.

Anyway, it looks like i should really be filing a bug report with the 
International Mathematical Union about this, rather than whingeing about 
it here.

tom

-- 
A military-industrial illusion of democracy



More information about the Python-list mailing list