Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
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ç
LibreOffice
core
Commits
4070dc72
Kaydet (Commit)
4070dc72
authored
Ara 07, 2012
tarafından
Pedro Giffuni
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i121421 - Mostly cosmetic fixes.
Attempt to comply with optional hungarian notation.
üst
9518f571
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
30 deletions
+29
-30
interpr1.cxx
sc/source/core/tool/interpr1.cxx
+29
-30
No files found.
sc/source/core/tool/interpr1.cxx
Dosyayı görüntüle @
4070dc72
...
...
@@ -1544,45 +1544,44 @@ void ScInterpreter::ScRandom()
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"sc"
,
"er"
,
"ScInterpreter::ScRandom"
);
static
sal_Int32
aScRandomIx
=
0
,
aScRandomIy
=
0
,
aScRandomIz
=
0
,
a
ScRandomIt
=
0
;
static
sal_Int32
nScRandomIx
=
0
,
nScRandomIy
=
0
,
nScRandomIz
=
0
,
n
ScRandomIt
=
0
;
static
rtlRandomPool
aPool
=
rtl_random_createPool
();
double
fScRandomW
;
// Seeding for the PRNG: should be good enough but we
// monitor the values to keep things under control.
if
(
a
ScRandomIx
<=
0
)
rtl_random_getBytes
(
aPool
,
&
aScRandomIx
,
sizeof
(
a
ScRandomIx
));
if
(
a
ScRandomIy
<=
0
)
rtl_random_getBytes
(
aPool
,
&
aScRandomIy
,
sizeof
(
a
ScRandomIy
));
if
(
a
ScRandomIz
<=
0
)
rtl_random_getBytes
(
aPool
,
&
aScRandomIz
,
sizeof
(
a
ScRandomIz
));
if
(
a
ScRandomIt
<=
0
)
rtl_random_getBytes
(
aPool
,
&
aScRandomIt
,
sizeof
(
a
ScRandomIt
));
if
(
n
ScRandomIx
<=
0
)
rtl_random_getBytes
(
aPool
,
&
nScRandomIx
,
sizeof
(
n
ScRandomIx
));
if
(
n
ScRandomIy
<=
0
)
rtl_random_getBytes
(
aPool
,
&
nScRandomIy
,
sizeof
(
n
ScRandomIy
));
if
(
n
ScRandomIz
<=
0
)
rtl_random_getBytes
(
aPool
,
&
nScRandomIz
,
sizeof
(
n
ScRandomIz
));
if
(
n
ScRandomIt
<=
0
)
rtl_random_getBytes
(
aPool
,
&
nScRandomIt
,
sizeof
(
n
ScRandomIt
));
// Basically unmodified algorithm from
// Wichman and Hill, "Generating good pseudo-random numbers",
// December 5, 2005.
double
aScRandomW
;
aScRandomIx
=
11600L
*
(
aScRandomIx
%
185127L
)
-
10379L
*
(
aScRandomIx
/
185127L
);
aScRandomIy
=
47003L
*
(
aScRandomIy
%
45688L
)
-
10479L
*
(
aScRandomIy
/
45688L
);
aScRandomIz
=
23000L
*
(
aScRandomIz
%
93368L
)
-
19423L
*
(
aScRandomIz
/
93368L
);
aScRandomIt
=
33000L
*
(
aScRandomIt
%
65075L
)
-
8123L
*
(
aScRandomIt
/
65075L
);
if
(
aScRandomIx
<
0
)
aScRandomIx
+=
2147483579L
;
if
(
aScRandomIy
<
0
)
aScRandomIy
+=
2147483543L
;
if
(
aScRandomIz
<
0
)
aScRandomIz
+=
2147483123L
;
if
(
aScRandomIt
<
0
)
aScRandomIt
+=
2147483123L
;
aScRandomW
=
(
double
)
aScRandomIx
*
0.0000000004656613022697297188506231646486
+
(
double
)
aScRandomIy
*
0.0000000004656613100759859932486569933169
+
(
double
)
aScRandomIz
*
0.0000000004656613360968421314794009471615
+
(
double
)
aScRandomIt
*
0.0000000004656614011489951998100056779817
;
PushDouble
(
aScRandomW
-
(
sal_Int64
)
aScRandomW
);
nScRandomIx
=
11600L
*
(
nScRandomIx
%
185127L
)
-
10379L
*
(
nScRandomIx
/
185127L
);
nScRandomIy
=
47003L
*
(
nScRandomIy
%
45688L
)
-
10479L
*
(
nScRandomIy
/
45688L
);
nScRandomIz
=
23000L
*
(
nScRandomIz
%
93368L
)
-
19423L
*
(
nScRandomIz
/
93368L
);
nScRandomIt
=
33000L
*
(
nScRandomIt
%
65075L
)
-
8123L
*
(
nScRandomIt
/
65075L
);
if
(
nScRandomIx
<
0
)
nScRandomIx
+=
2147483579L
;
if
(
nScRandomIy
<
0
)
nScRandomIy
+=
2147483543L
;
if
(
nScRandomIz
<
0
)
nScRandomIz
+=
2147483123L
;
if
(
nScRandomIt
<
0
)
nScRandomIt
+=
2147483123L
;
fScRandomW
=
(
double
)
nScRandomIx
*
0.0000000004656613022697297188506231646486
+
(
double
)
nScRandomIy
*
0.0000000004656613100759859932486569933169
+
(
double
)
nScRandomIz
*
0.0000000004656613360968421314794009471615
+
(
double
)
nScRandomIt
*
0.0000000004656614011489951998100056779817
;
PushDouble
(
fScRandomW
-
(
sal_Int32
)
fScRandomW
);
}
...
...
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