Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
66046626
Commit
66046626
authored
Mar 31, 2011
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Plain Diff
Add links to make the math docs more usable.
parents
a46ed118
1081d488
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
Doc/library/math.rst
Doc/library/math.rst
+23
-7
No files found.
Doc/library/math.rst
View file @
66046626
...
...
@@ -156,10 +156,10 @@ Power and logarithmic functions
.. function:: expm1(x)
Return ``e**x - 1``. For small floats *x*, the subtraction in
``exp(x) - 1`` can result in a significant loss of precision; the
:func:`expm1` function provides a way to compute this quantity to
full precision::
Return ``e**x - 1``. For small floats *x*, the subtraction in
``exp(x) - 1``
can result in a `significant loss of precision
<http://en.wikipedia.org/wiki/Loss_of_significance>`_\; the :func:`expm1`
fu
nction provides a way to compute this quantity to fu
ll precision::
>>> from math import exp, expm1
>>> exp(1e-5) - 1 # gives result accurate to 11 places
...
...
@@ -269,6 +269,9 @@ Angular conversion
Hyperbolic functions
--------------------
`Hyperbolic functions <http://en.wikipedia.org/wiki/Hyperbolic_function>`_
are analogs of trigonometric functions that are based on hyperbolas
instead of circles.
.. function:: acosh(x)
...
...
@@ -305,21 +308,34 @@ Special functions
.. function:: erf(x)
Return the error function at *x*.
Return the `error function <http://en.wikipedia.org/wiki/Error_function>`_ at
*x*.
The :func:`erf` function can be used to compute traditional statistical
functions such as the `cumulative standard normal distribution
<http://en.wikipedia.org/wiki/Normal_distribution#Cumulative_distribution_function>`_::
def phi(x):
'Cumulative distribution function for the standard normal distribution'
return (1.0 + erf(x / sqrt(2.0))) / 2.0
.. versionadded:: 3.2
.. function:: erfc(x)
Return the complementary error function at *x*.
Return the complementary error function at *x*. The `complementary error
function <http://en.wikipedia.org/wiki/Error_function>`_ is defined as
``1.0 - erf(x)``. It is used for large values of *x* where a straight
substraction from *1* would cause a `loss of significance
<http://en.wikipedia.org/wiki/Loss_of_significance>`_\.
.. versionadded:: 3.2
.. function:: gamma(x)
Return the
Gamma function
at *x*.
Return the
`Gamma function<http://en.wikipedia.org/wiki/Gamma_function>`
at *x*.
.. versionadded:: 3.2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment