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
1bcb99a9
Kaydet (Commit)
1bcb99a9
authored
Şub 01, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix int/long typecase. Add check for non-binary floating point.
üst
1aa8a696
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
floatobject.c
Objects/floatobject.c
+9
-2
No files found.
Objects/floatobject.c
Dosyayı görüntüle @
1bcb99a9
...
@@ -1158,7 +1158,7 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
...
@@ -1158,7 +1158,7 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
{
{
double
self
;
double
self
;
double
float_part
;
double
float_part
;
long
exponent
;
int
exponent
;
PyObject
*
prev
;
PyObject
*
prev
;
PyObject
*
py_exponent
=
NULL
;
PyObject
*
py_exponent
=
NULL
;
...
@@ -1172,6 +1172,13 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
...
@@ -1172,6 +1172,13 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
obj = call; \
obj = call; \
Py_DECREF(prev); \
Py_DECREF(prev); \
#ifdef FLT_RADIX
if
(
FLT_RADIX
!=
2
)
{
/* This routine depends on base-2 floating_point. */
Py_INCREF
(
Py_NotImplemented
);
return
Py_NotImplemented
;
}
#endif
CONVERT_TO_DOUBLE
(
v
,
self
);
CONVERT_TO_DOUBLE
(
v
,
self
);
if
(
Py_IS_INFINITY
(
self
))
{
if
(
Py_IS_INFINITY
(
self
))
{
...
@@ -1202,7 +1209,7 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
...
@@ -1202,7 +1209,7 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
/* now self = numerator * 2**exponent exactly; fold in 2**exponent */
/* now self = numerator * 2**exponent exactly; fold in 2**exponent */
denominator
=
PyLong_FromLong
(
1
);
denominator
=
PyLong_FromLong
(
1
);
py_exponent
=
PyLong_FromLong
(
labs
(
exponent
));
py_exponent
=
PyLong_FromLong
(
labs
(
(
long
)
exponent
));
if
(
py_exponent
==
NULL
)
goto
error
;
if
(
py_exponent
==
NULL
)
goto
error
;
INPLACE_UPDATE
(
py_exponent
,
INPLACE_UPDATE
(
py_exponent
,
long_methods
->
nb_lshift
(
denominator
,
py_exponent
));
long_methods
->
nb_lshift
(
denominator
,
py_exponent
));
...
...
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