Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ Power and logarithmic functions

.. function:: exp(x)

Return ``e**x``.

Return e raised to the power *x*, where e = 2.718281... is the base
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think e should be emphasized, like in log(), log1p, etc. Maybe e = 2.718281... should have the code markup.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's not clear. The problem with marking it up is that we get back to the issue where it could be confused with math.e. I decided not to mark it up, to be consistent with the documentation for math.e.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think math.expm1 needs to be changed too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csabella: Yes! How about

Return e raised to the power x, minus one. For small floats x, the [...]

?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e = 2.718281... is not a code. I don't think it should have the code markup.

Emphasized *e* is used in descriptions of log() and log1p(). But it also is used in frexp(). I suggest to rename e in frexp() description for avoiding confusion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be best to use Sphinx's inline math construct here. Is there anything that would prevent using :math: role in Python documentation?

of natural logarithms.

.. function:: expm1(x)

Expand Down