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
48688d8c
Kaydet (Commit)
48688d8c
authored
Şub 11, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add notes on how decimal fits into the model.
üst
21290eac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
numbers.py
Lib/numbers.py
+29
-0
No files found.
Lib/numbers.py
Dosyayı görüntüle @
48688d8c
...
...
@@ -49,6 +49,35 @@ Inexact.register(float)
# Inexact.register(decimal.Decimal)
## Notes on Decimal and how relates to the numeric tower
## -----------------------------------------------------
## Decimal is Real except that it does not support the real and imag properties
## or the conjugate() and complex() methods. If those get defined at some
## point, they cannot use the default implementation which would be sensitive
## to decimal.Context and could produce different answers at different times.
##
## Decimal has some of the characteristics of Integrals. It provides
## logical operations but not as operators. The logical operations only apply
## to a subset of decimals (those that are non-negative, have a zero exponent,
## and have digits that are only 0 or 1). It does provide __long__() and
## a three argument form of __pow__ that includes exactness guarantees.
## It does not provide an __index__() method.
##
## Depending on context, decimal operations may be exact or inexact.
##
## When decimal is run in a context with small precision and automatic rounding,
## it is Inexact. See the "Floating point notes" section of the decimal docs
## for an example of losing the associative and distributive properties of
## addition.
##
## When decimal is used for high precision integer arithmetic, it is Exact.
## When the decimal used as fixed-point, it is Exact.
## When it is run with sufficient precision, it is Exact.
## When the decimal.Inexact trap is set, decimal operations are Exact.
## For an example, see the float_to_decimal() recipe in the "Decimal FAQ"
## section of the docs -- it shows an how traps are used in conjunction
## with variable precision to reliably achieve exact results.
class
Complex
(
Number
):
"""Complex defines the operations that work on the builtin complex type.
...
...
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