[issue29956] math.exp documentation is misleading

2017-05-08 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue29956] math.exp documentation is misleading

2017-05-07 Thread Mark Dickinson
Mark Dickinson added the comment: Can this be closed? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue29956] math.exp documentation is misleading

2017-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset dbaf746b6de0ee431c809d3175ab40ccc18898a8 by Serhiy Storchaka in branch 'master': bpo-29956: Improve the math.exp() related documentation. (#1073) https://github.com/python/cpython/commit/dbaf746b6de0ee431c809d3175ab40ccc18898a8 -- ___

[issue29956] math.exp documentation is misleading

2017-05-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could anybody please make a review of PR 1073? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch applies Mark's fix to math.expm1() and cmath.exp(), adds the accuracy note to math.exp(), adds italic to mathematical constants, fixes empty lines. -- ___ Python tracker

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1216 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is the original issue, it isn't invented by me. ``math.e`` is the nearest representable value to the mathematical constant *e* and ``math.exp(x)`` is the nearest representable value to the mathematical constant *e* raised to the power *x*, but not the ne

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The only issue is how to distinguish ``math`` constant ``e`` > from mathematical constant *e*. Sorry, I think you're inventing an issue here. ``math.e`` is the nearest representable value to the mathematical constant *e*. This is no more interesting or

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nuances of expm1(), log1p(), log2() and log10() aren't beginner topics, but they are documented. I think it wouldn't harm if add "This is usually more accurate than ``e ** x`` or ``pow(e, x)``." The only issue is how to distinguish ``math`` constant ``e`` fr

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, these kind of nuances really aren't beginner topics. -- ___ Python tracker ___ ___ Python-b

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Raymond added his comment while I was writing mine. A FAQ with added caveats might be even better, but it will be mostly missed. If we add one, I might add a comment to some of the SO questions. -- ___ Python trac

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: To include corner cases, I should have asked 'at least as accurate' rather than 'more accurate'. It would be a sad libm that had specialized functions worse than pow, since the specialized functions could, at worse, use pow. For an expert point of view, the r

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Is math.exp(x) always more accurate than math.e ** x? It is usually at least as accurate, but we can't really guarantee anything because math.exp does whatever the underlying C math library does (so good libary -> good result, bad library -> bad result).

[issue29956] math.exp documentation is misleading

2017-04-09 Thread Mark Dickinson
Mark Dickinson added the comment: > Is math.exp(x) always more accurate than math.e ** x? As Serhiy says: not always, and in general the answer is going to depend on the relative quality of the libm implementations of pow and exp. But on typical machines, it is going to be true that `math.exp(

[issue29956] math.exp documentation is misleading

2017-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not always. For example for x = 0 both methods give the same exact result. -- ___ Python tracker ___ _

[issue29956] math.exp documentation is misleading

2017-04-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Is math.exp(x) always more accurate than math.e ** x? If so, doc could say so. Otherwise, should this be closed? -- nosy: +terry.reedy ___ Python tracker ___

[issue29956] math.exp documentation is misleading

2017-04-01 Thread Mark Dickinson
Mark Dickinson added the comment: PR made. New wording is: """ Return e raised to the power *x*, where e = 2.718281... is the base of natural logarithms. """ -- ___ Python tracker

[issue29956] math.exp documentation is misleading

2017-04-01 Thread Mark Dickinson
Changes by Mark Dickinson : -- pull_requests: +1133 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29956] math.exp documentation is misleading

2017-04-01 Thread Mark Dickinson
Mark Dickinson added the comment: > I suggest changing the main docs to match the existing docstring, "Return e > raised to the power of x." +1 for this description. -- ___ Python tracker __

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I suggest changing the main docs to match the existing docstring, "Return e raised to the power of x." The exp() function is a thin wrapper around the C math library and where it is documented as "compute e (the base of natural logarithms) raised to the p

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: *e*:sup:`x` ? I like this idea. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > This is because math.e is not the same as e. Right. That's why I think it would be nice to distinguish math.e and the base of the natural logarithm typographically in the docs. Can we use sphinx math mode? If not, I would use italic for the mathemat

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is because math.e is not the same as e. -- nosy: +mark.dickinson, rhettinger, serhiy.storchaka, stutzbach, tim.peters ___ Python tracker

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: The math.exp(x) function is documented to "Return e**x" . This is misleading because even in the simplest case, math.exp(x) is not the same as math.e ** x: >>> import math >>> math.exp(2) - math.e