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
25885d1d
Kaydet (Commit)
25885d1d
authored
May 12, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27005: Optimized the float.fromhex() class method for exact float.
üst
871639a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
NEWS
Misc/NEWS
+3
-0
floatobject.c
Objects/floatobject.c
+5
-6
No files found.
Misc/NEWS
Dosyayı görüntüle @
25885d1d
...
...
@@ -10,6 +10,9 @@ Release date: tba
Core and Builtins
-----------------
- Issue #27005: Optimized the float.fromhex() class method for exact float.
It is now 2 times faster.
- Issue #18531: Single var-keyword argument of dict subtype was passed
unscathed to the C-defined function. Now it is converted to exact dict.
...
...
Objects/floatobject.c
Dosyayı görüntüle @
25885d1d
...
...
@@ -1195,7 +1195,7 @@ Return a hexadecimal representation of a floating-point number.\n\
static
PyObject
*
float_fromhex
(
PyObject
*
cls
,
PyObject
*
arg
)
{
PyObject
*
result
_as_float
,
*
result
;
PyObject
*
result
;
double
x
;
long
exp
,
top_exp
,
lsb
,
key_digit
;
char
*
s
,
*
coeff_start
,
*
s_store
,
*
coeff_end
,
*
exp_start
,
*
s_end
;
...
...
@@ -1410,11 +1410,10 @@ float_fromhex(PyObject *cls, PyObject *arg)
s
++
;
if
(
s
!=
s_end
)
goto
parse_error
;
result_as_float
=
Py_BuildValue
(
"(d)"
,
negate
?
-
x
:
x
);
if
(
result_as_float
==
NULL
)
return
NULL
;
result
=
PyObject_CallObject
(
cls
,
result_as_float
);
Py_DECREF
(
result_as_float
);
result
=
PyFloat_FromDouble
(
negate
?
-
x
:
x
);
if
(
cls
!=
(
PyObject
*
)
&
PyFloat_Type
&&
result
!=
NULL
)
{
Py_SETREF
(
result
,
PyObject_CallFunctionObjArgs
(
cls
,
result
));
}
return
result
;
overflow_error:
...
...
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