This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients belopolsky, docs@python, mark.dickinson, rhettinger, serhiy.storchaka, stutzbach, terry.reedy, tim.peters
Date 2017-04-09.16:12:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491754374.45.0.458085211161.issue29956@psf.upfronthosting.co.za>
In-reply-to
Content
> 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(x)` is a better (faster, more accurate) way of computing the exponential function than `math.e ** x`. (Similarly, `math.sqrt(x)` should be preferred over `x ** 0.5`.) I'm not sure whether it's worth encoding such recommendations in the documentation or not.
History
Date User Action Args
2017-04-09 16:12:54mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, terry.reedy, belopolsky, stutzbach, docs@python, serhiy.storchaka
2017-04-09 16:12:54mark.dickinsonsetmessageid: <1491754374.45.0.458085211161.issue29956@psf.upfronthosting.co.za>
2017-04-09 16:12:54mark.dickinsonlinkissue29956 messages
2017-04-09 16:12:54mark.dickinsoncreate