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
bae1b94d
Kaydet (Commit)
bae1b94d
authored
Agu 10, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove long integer output.
üst
3d1c7dec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
floatingpoint.rst
Doc/tutorial/floatingpoint.rst
+6
-6
No files found.
Doc/tutorial/floatingpoint.rst
Dosyayı görüntüle @
bae1b94d
...
...
@@ -173,24 +173,24 @@ and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< 2**53``),
the best value for *N* is 56::
>>> 2**52
4503599627370496
L
4503599627370496
>>> 2**53
9007199254740992
L
9007199254740992
>>> 2**56/10
720575940379279
3L
720575940379279
4.0
That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. The
best possible value for *J* is then that quotient rounded::
>>> q, r = divmod(2**56, 10)
>>> r
6
L
6
Since the remainder is more than half of 10, the best approximation is obtained
by rounding up::
>>> q+1
7205759403792794
L
7205759403792794
Therefore the best possible approximation to 1/10 in 754 double precision is
that over 2\*\*56, or ::
...
...
@@ -211,7 +211,7 @@ If we multiply that fraction by 10\*\*30, we can see the (truncated) value of
its 30 most significant decimal digits::
>>> 7205759403792794 * 10**30 / 2**56
100000000000000005551115123125
L
100000000000000005551115123125
meaning that the exact number stored in the computer is approximately equal to
the decimal value 0.100000000000000005551115123125. Rounding that to 17
...
...
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