[Python-ideas] math.inf and math.nan constants
Steven D'Aprano
steve at pearwood.info
Wed Jan 7 19:35:33 CET 2015
On Wed, Jan 07, 2015 at 08:16:18AM -0800, Guido van Rossum wrote:
> I suppose you would also be in favor of defining e = math.exp(1) in
> favor of math.e?
Euler's Number e is an important mathematical constant, but I'm not sure
that it is a useful *programming* constant, more useful than (say) γ,
the Euler-Mascheroni constant which is also ubiquitous in mathematics. I
can't think of any reason to use e on its own, apart from exponentials
and logs, where we have functions which are more accurate than calling
e**x directly.
If e wasn't already in the math module, I don't think there are enough
use-cases to justify adding it. Plenty of other languages don't (e.g.
Haskell and Lua). I think math.tau would be much more useful and
important than e :-)
http://bugs.python.org/issue12345
> I say bah to that long-winded diatribe.
Long-winded, perhaps, but a diatribe? (Definition on WordNet:
"thunderous verbal attack".)
--
Steve
More information about the Python-ideas
mailing list