mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Release calc version 2.11.0t10
This commit is contained in:
20
help/rand
20
help/rand
@@ -19,7 +19,7 @@ DESCRIPTION
|
||||
pseudo-random generator. If you need a fast generator and do not
|
||||
need a cryptographically strong one, this generator is likely to do
|
||||
the job. Casual direct use of the shuffle generator may be
|
||||
acceptable. For a much higher quality cryptographically strong
|
||||
acceptable. For a much higher quality cryptographically strong
|
||||
(but slower) generator use the Blum-Blum-Shub generator (see the
|
||||
random help page).
|
||||
|
||||
@@ -55,9 +55,9 @@ DESCRIPTION
|
||||
by Knuth, Vol 2, 2nd edition (1981), Section 3.2.2, page 32,
|
||||
Algorithm B.
|
||||
|
||||
The rand generator has a good period, and is fast. It is reasonable as
|
||||
The rand generator has a good period, and is fast. It is reasonable as
|
||||
generators go, though there are better ones available. The shuffle
|
||||
method has a very good period, and is fast. It is fairly good as
|
||||
method has a very good period, and is fast. It is fairly good as
|
||||
generators go, particularly when it is feed reasonably random
|
||||
numbers. Because of this, we use feed values from the additive 55
|
||||
method into the shuffle method.
|
||||
@@ -120,7 +120,7 @@ DESCRIPTION
|
||||
perceptions that are noted above.
|
||||
|
||||
It should be noted that the purpose of randreseed64 is to scramble a
|
||||
seed ONLY. We do not care if these generators produce good random
|
||||
seed ONLY. We do not care if these generators produce good random
|
||||
numbers. We only want to help eliminate the human factors & perceptions
|
||||
noted above.
|
||||
|
||||
@@ -144,8 +144,8 @@ DESCRIPTION
|
||||
|
||||
We will select the randreseed64 multiplier 'a' such that:
|
||||
|
||||
a mod 8 == 5 (based on note iii)
|
||||
0.01*m < a < 0.99*m (based on note iv)
|
||||
a mod 8 == 5 (based on note iii)
|
||||
0.01*m < a < 0.99*m (based on note iv)
|
||||
0.01*2^64 < a < 0.99*2^64
|
||||
a is prime (help keep the generators independent)
|
||||
|
||||
@@ -159,10 +159,10 @@ DESCRIPTION
|
||||
gcd(a, c) == 1 (adders & multipliers will be more independent)
|
||||
|
||||
The values 'a' and 'c for randreseed64 are taken from the Rand book
|
||||
of numbers. Because m=2^64 is 20 decimal digits long, we will
|
||||
of numbers. Because m=2^64 is 20 decimal digits long, we will
|
||||
search the Rand book of numbers 20 at a time. We will skip any of
|
||||
the 55 values that were used to initialize the additive 55
|
||||
generators. The values obtained from the Rand book are:
|
||||
generators. The values obtained from the Rand book are:
|
||||
|
||||
a = 6316878969928993981
|
||||
c = 1363042948800878693
|
||||
@@ -180,12 +180,12 @@ DESCRIPTION
|
||||
One might object to the complexity of the seed scramble/mapping via
|
||||
the randreseed64 process. But Calling srand(0) with the randreseed64
|
||||
process would be the same as calling srand(10239951819489363767)
|
||||
without it. No extra security is gained or reduced by using the
|
||||
without it. No extra security is gained or reduced by using the
|
||||
randreseed64 process. The meaning of seeds are exchanged, but not
|
||||
lost or favored (used by more than one input seed).
|
||||
|
||||
The randreseed64 process does not reduce the security of the rand
|
||||
generator. Every seed is converted into a different unique seed.
|
||||
generator. Every seed is converted into a different unique seed.
|
||||
No seed is ignored or favored.
|
||||
|
||||
The truly paranoid might suggest that my claims in the MAGIC NUMBERS
|
||||
|
Reference in New Issue
Block a user