Discussion:
[Python-3000-checkins] r66808 - python/branches/py3k/Doc/tutorial/floatingpoint.rst
raymond.hettinger
2008-10-05 17:57:52 UTC
Permalink
Author: raymond.hettinger
Date: Sun Oct 5 19:57:52 2008
New Revision: 66808

Log:
Issue 3412: Mention fractions and decimal in the tutorial section on floating point.

Modified:
python/branches/py3k/Doc/tutorial/floatingpoint.rst

Modified: python/branches/py3k/Doc/tutorial/floatingpoint.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/floatingpoint.rst (original)
+++ python/branches/py3k/Doc/tutorial/floatingpoint.rst Sun Oct 5 19:57:52 2008
@@ -135,6 +135,14 @@
:func:`str` usually suffices, and for finer control see the :meth:`str.format`
method's format specifiers in :ref:`formatstrings`.

+For use cases which require exact decimal representation, try using the
+:mod:`decimal` module which implements decimal arithmetic suitable for
+accounting applications and high-precision applications.
+
+Another form of exact arithmetic is supported by the :mod:`fractions` module
+which implements arithmetic based on rational numbers (so the numbers like
+1/3 can be represented exactly).
+
If you are a heavy user of floating point operations you should take a look
at the Numerical Python package and many other packages for mathematical and
statistical operations supplied by the SciPy project. See <http://scipy.org>.
Loading...