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
129fe04d
Kaydet (Commit)
129fe04d
authored
May 08, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26512: Clarify Integral; tidy up table of rounding functions
Based on patch by Julien.
üst
ad1fd346
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
17 deletions
+20
-17
stdtypes.rst
Doc/library/stdtypes.rst
+16
-13
mathmodule.c
Modules/mathmodule.c
+4
-4
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
129fe04d
...
...
@@ -361,19 +361,22 @@ Notes:
All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include
the following operations:
+--------------------+------------------------------------+--------+
| Operation | Result | Notes |
+====================+====================================+========+
| ``math.trunc(x)`` | *x* truncated to Integral | |
+--------------------+------------------------------------+--------+
| ``round(x[, n])`` | *x* rounded to n digits, | |
| | rounding half to even. If n is | |
| | omitted, it defaults to 0. | |
+--------------------+------------------------------------+--------+
| ``math.floor(x)`` | the greatest integral float <= *x* | |
+--------------------+------------------------------------+--------+
| ``math.ceil(x)`` | the least integral float >= *x* | |
+--------------------+------------------------------------+--------+
+--------------------+---------------------------------------------+
| Operation | Result |
+====================+=============================================+
| :func:`math.trunc(\| *x* truncated to :class:`~numbers.Integral` |
| x) <math.trunc>` | |
+--------------------+---------------------------------------------+
| :func:`round(x[, | *x* rounded to *n* digits, |
| n]) <round>` | rounding half to even. If *n* is |
| | omitted, it defaults to 0. |
+--------------------+---------------------------------------------+
| :func:`math.floor(\| the greatest :class:`~numbers.Integral` |
| x) <math.floor>` | <= *x* |
+--------------------+---------------------------------------------+
| :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* |
| <math.ceil>` | |
+--------------------+---------------------------------------------+
For additional numeric operations see the :mod:`math` and :mod:`cmath`
modules.
...
...
Modules/mathmodule.c
Dosyayı görüntüle @
129fe04d
...
...
@@ -957,8 +957,8 @@ static PyObject * math_ceil(PyObject *self, PyObject *number) {
}
PyDoc_STRVAR
(
math_ceil_doc
,
"ceil(x)
\n\n
Return the ceiling of x as an
int
.
\n
"
"This is the smallest integ
ral value
>= x."
);
"ceil(x)
\n\n
Return the ceiling of x as an
Integral
.
\n
"
"This is the smallest integ
er
>= x."
);
FUNC2
(
copysign
,
copysign
,
"copysign(x, y)
\n\n
Return a float with the magnitude (absolute value) "
...
...
@@ -997,8 +997,8 @@ static PyObject * math_floor(PyObject *self, PyObject *number) {
}
PyDoc_STRVAR
(
math_floor_doc
,
"floor(x)
\n\n
Return the floor of x as an
int
.
\n
"
"This is the largest integ
ral value
<= x."
);
"floor(x)
\n\n
Return the floor of x as an
Integral
.
\n
"
"This is the largest integ
er
<= x."
);
FUNC1A
(
gamma
,
m_tgamma
,
"gamma(x)
\n\n
Gamma function at x."
)
...
...
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