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
3c212163
Kaydet (Commit)
3c212163
authored
Tem 19, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improve accuracy of gamma test function
üst
f032a002
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
test_random.py
Lib/test/test_random.py
+3
-5
No files found.
Lib/test/test_random.py
Dosyayı görüntüle @
3c212163
...
...
@@ -5,7 +5,7 @@ import random
import
time
import
pickle
import
warnings
from
math
import
log
,
exp
,
sqrt
,
pi
from
math
import
log
,
exp
,
sqrt
,
pi
,
sum
as
msum
from
test
import
test_support
class
TestBasicOps
(
unittest
.
TestCase
):
...
...
@@ -465,11 +465,9 @@ _gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289,
def
gamma
(
z
,
cof
=
_gammacoeff
,
g
=
7
):
z
-=
1.0
sum
=
cof
[
0
]
for
i
in
xrange
(
1
,
len
(
cof
)):
sum
+=
cof
[
i
]
/
(
z
+
i
)
s
=
msum
([
cof
[
0
]]
+
[
cof
[
i
]
/
(
z
+
i
)
for
i
in
range
(
1
,
len
(
cof
))])
z
+=
0.5
return
(
z
+
g
)
**
z
/
exp
(
z
+
g
)
*
sqrt
(
2
*
pi
)
*
sum
return
(
z
+
g
)
**
z
/
exp
(
z
+
g
)
*
sqrt
(
2
.0
*
pi
)
*
s
class
TestDistributions
(
unittest
.
TestCase
):
def
test_zeroinputs
(
self
):
...
...
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