New submission from Raymond Hettinger <raymond.hettin...@gmail.com>:

Currently the docs say, "The result is calculated in a way which is accurate 
for x near zero."

That is somewhat vague.  Some quick tests show that it is often more accurate 
than log() for the whole range of 0.0 < x < 1.0; however, for x < 0.0 it is 
always worse.

Since the function is just a pass-through to the C library, we probably can't 
make any guarantees.  On the other hand, it is hard to know when this function 
is preferred without some guidance.

----------
assignee: docs@python
components: Documentation
files: study_log1p.py
messages: 346942
nosy: docs@python, mark.dickinson, rhettinger, tim.peters
priority: low
severity: normal
status: open
title: Clarify docs for math.log1p()
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48448/study_log1p.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37454>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to