mirror of
https://github.com/acaloiaro/mersenne-twister-gnur
synced 2026-07-21 18:29:17 +00:00
Eliminated unnecessary bit-masking
This commit is contained in:
parent
5edc98dc93
commit
8e6f95b124
1 changed files with 2 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ public class MersenneTwister {
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
// Unsign the incoming seed
|
// Unsign the incoming seed
|
||||||
int s = (int) (seed & 0xFFFFFFFFL);
|
int s = (int) (seed & 0x0000FFFFL);
|
||||||
|
|
||||||
// Initial seed scrambling ( GNU R Convention )
|
// Initial seed scrambling ( GNU R Convention )
|
||||||
for (j = 0; j < GNU_R_SEED_SCRAMBLE_CONSTANT; j++)
|
for (j = 0; j < GNU_R_SEED_SCRAMBLE_CONSTANT; j++)
|
||||||
|
|
@ -71,7 +71,7 @@ public class MersenneTwister {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default the first element to unsigned N ( A GNU R convention )
|
// Default the first element to unsigned N ( A GNU R convention )
|
||||||
stateVector[0] = (N & 0xFFFFFFFF);
|
stateVector[0] = N;
|
||||||
|
|
||||||
// Check for all zeros to be safe
|
// Check for all zeros to be safe
|
||||||
boolean notallzero = true;
|
boolean notallzero = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue