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
71260b84
Kaydet (Commit)
71260b84
authored
May 11, 2000
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added math.rint() -- round according to current IEEE754 mode
üst
dab6cb8f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
0 deletions
+16
-0
libmath.tex
Doc/lib/libmath.tex
+4
-0
mymath.h
Include/mymath.h
+2
-0
test_math
Lib/test/output/test_math
+1
-0
test_math.py
Lib/test/test_math.py
+6
-0
mathmodule.c
Modules/mathmodule.c
+3
-0
No files found.
Doc/lib/libmath.tex
Dosyayı görüntüle @
71260b84
...
@@ -93,6 +93,10 @@ carry the sign of \var{x}. The integer part is returned as a real.
...
@@ -93,6 +93,10 @@ carry the sign of \var{x}. The integer part is returned as a real.
Return
\code
{
\var
{
x
}
**
\var
{
y
}}
.
Return
\code
{
\var
{
x
}
**
\var
{
y
}}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
rint
}{
x, y
}
Return the integer nearest to
\var
{
x
}
as a real.
\end{funcdesc}
\begin{funcdesc}
{
sin
}{
x
}
\begin{funcdesc}
{
sin
}{
x
}
Return the sine of
\var
{
x
}
.
Return the sine of
\var
{
x
}
.
\end{funcdesc}
\end{funcdesc}
...
...
Include/mymath.h
Dosyayı görüntüle @
71260b84
...
@@ -48,6 +48,7 @@ extern double hypot Py_PROTO((double, double));
...
@@ -48,6 +48,7 @@ extern double hypot Py_PROTO((double, double));
#undef log
#undef log
#undef log10
#undef log10
#undef pow
#undef pow
#undef rint
#undef sin
#undef sin
#undef sinh
#undef sinh
#undef sqrt
#undef sqrt
...
@@ -67,6 +68,7 @@ extern double hypot Py_PROTO((double, double));
...
@@ -67,6 +68,7 @@ extern double hypot Py_PROTO((double, double));
#define log logd
#define log logd
#define log10 log10d
#define log10 log10d
#define pow powd
#define pow powd
#define rint rintd
#define sin sind
#define sin sind
#define sinh sinhd
#define sinh sinhd
#define sqrt sqrtd
#define sqrt sqrtd
...
...
Lib/test/output/test_math
Dosyayı görüntüle @
71260b84
...
@@ -19,6 +19,7 @@ log
...
@@ -19,6 +19,7 @@ log
log10
log10
modf
modf
pow
pow
rint
sin
sin
sinh
sinh
sqrt
sqrt
...
...
Lib/test/test_math.py
Dosyayı görüntüle @
71260b84
...
@@ -129,6 +129,12 @@ testit('pow(1,0)', math.pow(1,0), 1)
...
@@ -129,6 +129,12 @@ testit('pow(1,0)', math.pow(1,0), 1)
testit
(
'pow(2,1)'
,
math
.
pow
(
2
,
1
),
2
)
testit
(
'pow(2,1)'
,
math
.
pow
(
2
,
1
),
2
)
testit
(
'pow(2,-1)'
,
math
.
pow
(
2
,
-
1
),
0.5
)
testit
(
'pow(2,-1)'
,
math
.
pow
(
2
,
-
1
),
0.5
)
print
'rint'
testit
(
'rint(0.7)'
,
math
.
rint
(
0.7
),
1
)
testit
(
'rint(-0.3)'
,
math
.
rint
(
-
0.3
),
0
)
testit
(
'rint(2.5)'
,
math
.
rint
(
2.5
),
2
)
testit
(
'rint(3.5)'
,
math
.
rint
(
3.5
),
4
)
print
'sin'
print
'sin'
testit
(
'sin(0)'
,
math
.
sin
(
0
),
0
)
testit
(
'sin(0)'
,
math
.
sin
(
0
),
0
)
testit
(
'sin(pi/2)'
,
math
.
sin
(
math
.
pi
/
2
),
1
)
testit
(
'sin(pi/2)'
,
math
.
sin
(
math
.
pi
/
2
),
1
)
...
...
Modules/mathmodule.c
Dosyayı görüntüle @
71260b84
...
@@ -156,6 +156,8 @@ FUNC2(math_pow, power, math_pow_doc,
...
@@ -156,6 +156,8 @@ FUNC2(math_pow, power, math_pow_doc,
FUNC2
(
math_pow
,
pow
,
math_pow_doc
,
FUNC2
(
math_pow
,
pow
,
math_pow_doc
,
"pow(x,y)
\n\n
Return x**y."
)
"pow(x,y)
\n\n
Return x**y."
)
#endif
#endif
FUNC1
(
math_rint
,
rint
,
math_rint_doc
,
"rint(x)
\n\n
Return the integer nearest to x as a real."
)
FUNC1
(
math_sin
,
sin
,
math_sin_doc
,
FUNC1
(
math_sin
,
sin
,
math_sin_doc
,
"sin(x)
\n\n
Return the sine of x."
)
"sin(x)
\n\n
Return the sine of x."
)
FUNC1
(
math_sinh
,
sinh
,
math_sinh_doc
,
FUNC1
(
math_sinh
,
sinh
,
math_sinh_doc
,
...
@@ -267,6 +269,7 @@ static PyMethodDef math_methods[] = {
...
@@ -267,6 +269,7 @@ static PyMethodDef math_methods[] = {
{
"log10"
,
math_log10
,
0
,
math_log10_doc
},
{
"log10"
,
math_log10
,
0
,
math_log10_doc
},
{
"modf"
,
math_modf
,
0
,
math_modf_doc
},
{
"modf"
,
math_modf
,
0
,
math_modf_doc
},
{
"pow"
,
math_pow
,
0
,
math_pow_doc
},
{
"pow"
,
math_pow
,
0
,
math_pow_doc
},
{
"rint"
,
math_rint
,
0
,
math_rint_doc
},
{
"sin"
,
math_sin
,
0
,
math_sin_doc
},
{
"sin"
,
math_sin
,
0
,
math_sin_doc
},
{
"sinh"
,
math_sinh
,
0
,
math_sinh_doc
},
{
"sinh"
,
math_sinh
,
0
,
math_sinh_doc
},
{
"sqrt"
,
math_sqrt
,
0
,
math_sqrt_doc
},
{
"sqrt"
,
math_sqrt
,
0
,
math_sqrt_doc
},
...
...
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