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
fee346b5
Kaydet (Commit)
fee346b5
authored
Nis 17, 2009
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Nits.
üst
3e09f43e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
3.1.rst
Doc/whatsnew/3.1.rst
+4
-4
No files found.
Doc/whatsnew/3.1.rst
Dosyayı görüntüle @
fee346b5
...
@@ -155,7 +155,7 @@ Some smaller changes made to the core Python language are:
...
@@ -155,7 +155,7 @@ Some smaller changes made to the core Python language are:
The significance is easily seen with a number like ``1.1`` which does not
The significance is easily seen with a number like ``1.1`` which does not
have an exact equivalent in binary floating point. Since there is no exact
have an exact equivalent in binary floating point. Since there is no exact
equivalent, an expression like ``float(
"1.1"
)`` evaluates to the nearest
equivalent, an expression like ``float(
'1.1'
)`` evaluates to the nearest
representable value which is ``0x1.199999999999ap+0`` in hex or
representable value which is ``0x1.199999999999ap+0`` in hex or
``1.100000000000000088817841970012523233890533447265625`` in decimal. That
``1.100000000000000088817841970012523233890533447265625`` in decimal. That
nearest value was and still is used in subsequent floating point
nearest value was and still is used in subsequent floating point
...
@@ -163,16 +163,16 @@ Some smaller changes made to the core Python language are:
...
@@ -163,16 +163,16 @@ Some smaller changes made to the core Python language are:
What is new is how the number gets displayed. Formerly, Python used a
What is new is how the number gets displayed. Formerly, Python used a
simple approach. The value of ``repr(1.1)`` was computed as ``format(1.1,
simple approach. The value of ``repr(1.1)`` was computed as ``format(1.1,
'.17g')`` which evaluate
s
to ``'1.1000000000000001'``. The advantage of
'.17g')`` which evaluate
d
to ``'1.1000000000000001'``. The advantage of
using 17 digits was that it relied on IEEE-754 guarantees to assure that
using 17 digits was that it relied on IEEE-754 guarantees to assure that
``eval(repr(1.1))`` would round-trip exactly to its original value. The
``eval(repr(1.1))`` would round-trip exactly to its original value. The
disadvantage is that many people found the output to be confusing (mistaking
disadvantage is that many people found the output to be confusing (mistaking
intrinsic limitations of binary floating point representation as being a
intrinsic limitations of binary floating point representation as being a
problem with Python itself).
problem with Python itself).
The new algorithm for ``repr(1.1)`` is smarter and returns ``
1.1
``.
The new algorithm for ``repr(1.1)`` is smarter and returns ``
'1.1'
``.
Effectively, it searches all equivalent string representations (ones that
Effectively, it searches all equivalent string representations (ones that
get stored
as
the same underlying float value) and returns the shortest
get stored
with
the same underlying float value) and returns the shortest
representation.
representation.
The new algorithm tends to emit cleaner representations when possible, but
The new algorithm tends to emit cleaner representations when possible, but
...
...
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