Re: ** Operator
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: ** Operator

From: Christoph Zwerschke <cito@online.de>
Date: Mon Mar 20 2006 - 16:23:59 CET

Ziga Seilnacht wrote:
> Christoph Zwerschke wrote:
>> In the explanation about pow() at
>> http://docs.python.org/lib/built-in-funcs.html, the notation 10**2 is
>> suddenly used, without explaining that it is equivalent to pow(10,2). I
>> think this could be improved in the docs.
>
> It is:
> http://docs.python.org/lib/typesnumeric.html

You're right, it's mentioned there in section 2.3.4, but the explanation
of pow() is already in section 2.1 prior to that.

So it would be nice if the paragraph explaining pow() would mention that
you can also write x**y for pow(x,y). And/or the example given in the
paragraph should say pow(10,2) instead of 10**2. Otherwise it's a bit
confusing for somebody who reads in chronological order and doesn't know
about the ** syntax (many other languages write x^y instead of x**y).

-- Christoph
Received on Sun Apr 30 20:38:43 2006