Mathematics in Python are not correct

Lou Pecora pecora at anvil.nrl.navy.mil
Mon May 12 11:38:19 EDT 2008


In article 
<f6743b81-9324-46dd-bbd3-ef8812e28197 at d77g2000hsb.googlegroups.com>,
 wxPythoner at gmail.com wrote:

> I am stunned that this simple misunderstanding of mine ended in a
> mathematical clash of a sort. :)  You guys really blew me away wih
> your mathematical knowledge. And also the 0**0 is a thing I've never
> thought about trying, until now that is. If the mathematical rule is
> that EVERYTHING raised to the power of 0 is 1, then we should accept
> that, even in the case of 0**0. This is just the way it is.

Well, it's really not that simple.  You've seen that 0**0 can lead to 
problems in various areas of mathematics (check the Wikipedia article on 
analysis/calculus application vs. combinatorics and discrete math).  You 
have to be aware of those dangers, what the language (Python here), and 
what your application requires.  Consistency in mathematics is vital.  
If you are using 0**0=1, then your code should be consistent with that 
usage.

-- 
-- Lou Pecora



More information about the Python-list mailing list