Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
17baef0b
Kaydet (Commit)
17baef0b
authored
Mar 22, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Activate the Sphinx doctest extension and convert howto/functional to use it.
üst
86f38c81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
Makefile
Doc/Makefile
+5
-0
conf.py
Doc/conf.py
+2
-1
decimal.rst
Doc/library/decimal.rst
+12
-5
No files found.
Doc/Makefile
Dosyayı görüntüle @
17baef0b
...
...
@@ -82,6 +82,11 @@ coverage: BUILDER = coverage
coverage
:
build
@
echo
"Coverage finished; see c.txt and python.txt in build/coverage"
doctest
:
BUILDER = doctest
doctest
:
build
@
echo
"Testing of doctests in the sources finished, look at the "
\
"results in build/doctest/output.txt"
clean
:
-
rm
-rf
build/
*
-
rm
-rf
tools/sphinx
Doc/conf.py
Dosyayı görüntüle @
17baef0b
...
...
@@ -13,7 +13,8 @@ sys.path.append('tools/sphinxext')
# General configuration
# ---------------------
extensions
=
[
'sphinx.ext.refcounting'
,
'sphinx.ext.coverage'
]
extensions
=
[
'sphinx.ext.refcounting'
,
'sphinx.ext.coverage'
,
'sphinx.ext.doctest'
]
templates_path
=
[
'tools/sphinxext'
]
# General substitutions.
...
...
Doc/library/decimal.rst
Dosyayı görüntüle @
17baef0b
...
...
@@ -15,9 +15,12 @@
.. sectionauthor:: Raymond D. Hettinger <python at rcn.com>
.. versionadded:: 2.4
.. testsetup:: *
from decimal import *
The :mod:`decimal` module provides support for decimal floating point
arithmetic. It offers several advantages over the :class:`float` datatype:
...
...
@@ -47,7 +50,7 @@ arithmetic. It offers several advantages over the :class:`float` datatype:
* Unlike hardware based binary floating point, the decimal module has a user
alterable precision (defaulting to 28 places) which can be as large as needed for
a given problem:
:
a given problem:
>>> getcontext().prec = 6
>>> Decimal(1) / Decimal(7)
...
...
@@ -115,7 +118,9 @@ Quick-start Tutorial
The usual start to using decimals is importing the module, viewing the current
context with :func:`getcontext` and, if necessary, setting new values for
precision, rounding, or enabled traps::
precision, rounding, or enabled traps:
.. doctest:: newcontext
>>> from decimal import *
>>> getcontext()
...
...
@@ -130,7 +135,7 @@ create a Decimal from a :class:`float`, first convert it to a string. This
serves as an explicit reminder of the details of the conversion (including
representation error). Decimal numbers include special values such as
:const:`NaN` which stands for "Not a number", positive and negative
:const:`Infinity`, and :const:`-0`.
::
:const:`Infinity`, and :const:`-0`.
>>> Decimal(10)
Decimal('10')
...
...
@@ -149,7 +154,9 @@ representation error). Decimal numbers include special values such as
The significance of a new Decimal is determined solely by the number of digits
input. Context precision and rounding only come into play during arithmetic
operations. ::
operations.
.. doctest:: newcontext
>>> getcontext().prec = 6
>>> Decimal('3.0')
...
...
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