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
a6cfeb4b
Kaydet (Commit)
a6cfeb4b
authored
Mar 16, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Update docs to reflect removal of Exact/Inexact
üst
5becac57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
27 deletions
+4
-27
numbers.rst
Doc/library/numbers.rst
+4
-27
No files found.
Doc/library/numbers.rst
Dosyayı görüntüle @
a6cfeb4b
...
...
@@ -8,9 +8,8 @@
The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric abstract
base classes which progressively define more operations. These concepts also
provide a way to distinguish exact from inexact types. None of the types defined
in this module can be instantiated.
base classes which progressively define more operations. None of the types
defined in this module can be instantiated.
.. class:: Number
...
...
@@ -19,27 +18,6 @@ in this module can be instantiated.
*x* is a number, without caring what kind, use ``isinstance(x, Number)``.
Exact and inexact operations
----------------------------
.. class:: Exact
Subclasses of this type have exact operations.
As long as the result of a homogenous operation is of the same type, you can
assume that it was computed exactly, and there are no round-off errors. Laws
like commutativity and associativity hold.
.. class:: Inexact
Subclasses of this type have inexact operations.
Given X, an instance of :class:`Inexact`, it is possible that ``(X + -X) + 3
== 3``, but ``X + (-X + 3) == 0``. The exact form this error takes will vary
by type, but it's generally unsafe to compare this type for equality.
The numeric tower
-----------------
...
...
@@ -79,7 +57,7 @@ The numeric tower
.. class:: Rational
Subtypes
both :class:`Real` and :class:`Exact`,
and adds
Subtypes
:class:`Real`
and adds
:attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which
should be in lowest terms. With these, it provides a default for
:func:`float`.
...
...
@@ -239,4 +217,4 @@ forward and reverse instances of any given operator. For example,
__add__, __radd__ = _operator_fallbacks(_add, operator.add)
# ...
\ No newline at end of file
# ...
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