Re: math.nroot [was Re: A brief question.]
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

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

From: OKB (not okblacke) <brenNOSPAMbarn@NObrenSPAMbarn.net>
Date: Mon Jul 04 2005 - 09:09:46 CEST

Tom Anderson wrote:

> Yes. However, it's an excellent reason why python's precedence
> rules are wrong - in conventional mathematical notation, the unary
> minus, used to denote the sign of a literal number, does indeed
> have higher precedence than exponentiation: -1^2 evaluates to 1,
> not -1.

            This isn't true. The "unary minus operator" is just a shorthand
for multiplication by -1. As such, it has the same operator precedence
as multiplication.

-- 
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is
no path, and leave a trail."
	--author unknown
Received on Thu Sep 29 16:44:28 2005