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
2d1aa335
Kaydet (Commit)
2d1aa335
authored
Şub 02, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simpler solution to handling non-IEEE 754 environments.
üst
f9859037
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
floatobject.c
Objects/floatobject.c
+3
-13
No files found.
Objects/floatobject.c
Dosyayı görüntüle @
2d1aa335
...
@@ -1173,13 +1173,6 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
...
@@ -1173,13 +1173,6 @@ 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,13 +1195,10 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
...
@@ -1202,13 +1195,10 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
for
(
i
=
0
;
i
<
300
&&
float_part
!=
floor
(
float_part
)
;
i
++
)
{
for
(
i
=
0
;
i
<
300
&&
float_part
!=
floor
(
float_part
)
;
i
++
)
{
float_part
*=
2
.
0
;
float_part
*=
2
.
0
;
exponent
--
;
exponent
--
;
}
if
(
i
==
300
)
{
/* Could not convert mantissa to an integer */
Py_INCREF
(
Py_NotImplemented
);
return
Py_NotImplemented
;
}
}
/* self == float_part * 2**exponent exactly and float_part is integral */
/* self == float_part * 2**exponent exactly and float_part is integral.
If FLT_RADIX != 2, the 300 steps may leave a tiny fractional part
to be truncated by PyLong_FromDouble(). */
numerator
=
PyLong_FromDouble
(
float_part
);
numerator
=
PyLong_FromDouble
(
float_part
);
if
(
numerator
==
NULL
)
goto
error
;
if
(
numerator
==
NULL
)
goto
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