Details
Open Watcom is a C/C++ compiler, and offers a Linear Congruential Generator in its standard library.
Because this is mainly a DOS compiler, it also masks the result so that only the last 15 bits are returned.
|
Pseudocode
// This code is adapted from the Open Watcom
// source code found here:
//
// https://github.com/open-watcom/open-watcom-v2
// The current state value
state = 1138;
// Our constants
a = 1103515245;
c = 12345;
// random number generator
function RandomNumber() {
// Run the function
state = (a * state) + c;
// Return the new value
return (state SHIFT_RIGHT 16) AND $7FFF;
}
|
Period Length TestSeed | Period Length | Result |
---|
1138 | 64000 | Passed | 65535 | 64000 | Passed | 8675309 | 64000 | Passed | 16777216 | 64000 | Passed | 123456789 | 64000 | Passed | Minimum to Pass: 64,000
| Plot Test  |
Count the 1s TestSeed | % Bits that are 1s | Result |
---|
1138 | 49.88% | Passed | 65535 | 49.81% | Passed | 8675309 | 49.91% | Passed | 16777216 | 49.93% | Passed | 123456789 | 50.02% | Passed | Minimum to Pass: 45%
| Dartboard TestSeed | Darts Placed | Result |
---|
1138 | 6939 | Passed | 65535 | 7017 | Passed | 16777216 | 7004 | Passed | 123456789 | 6995 | Passed | Minimum to Pass: 2,600
|
Crush TestSeed | Compression Rate | Result |
---|
1138 | 101.14% | Passed | 65535 | 101.14% | Passed | 8675309 | 101.14% | Passed | 16777216 | 101.14% | Passed | 123456789 | 101.14% | Passed | Minimum to Pass: 95%
| Unique Bytes TestSeed | Unique High Bytes | Unique Low Bytes | Result |
---|
1138 | 162 | 157 | Failed | 65535 | 170 | 162 | Passed | 8675309 | 167 | 161 | Passed | 16777216 | 160 | 161 | Passed | 123456789 | 154 | 167 | Failed | Minimum to Pass: 160
|
High/Low Byte TestSeed | High After High | High After Low | Low After High | Low After Low | Spread | Result |
---|
1138 | 2448 | 2548 | 2548 | 2455 | 193 | Passed | 65535 | 2420 | 2526 | 2525 | 2528 | 159 | Passed | 8675309 | 2679 | 2481 | 2481 | 2358 | 359 | Passed | 16777216 | 2545 | 2487 | 2487 | 2480 | 91 | Passed | 123456789 | 2517 | 2530 | 2529 | 2423 | 153 | Passed | Maximum to Pass: 500
|
Distribution TestSeed | 1138 | 65535 | 8675309 | 16777216 | 123456789 |
---|
0.0 to 0.1 | 1005 | 965 | 1048 | 1025 | 961 |
---|
0.1 to 0.2 | 989 | 970 | 1068 | 1034 | 1055 |
---|
0.2 to 0.3 | 1032 | 1018 | 988 | 1025 | 991 |
---|
0.3 to 0.4 | 929 | 1004 | 1051 | 1042 | 1029 |
---|
0.4 to 0.5 | 1041 | 990 | 1006 | 906 | 1012 |
---|
0.5 to 0.6 | 978 | 1013 | 965 | 1042 | 965 |
---|
0.6 to 0.7 | 989 | 995 | 999 | 997 | 1018 |
---|
0.7 to 0.8 | 996 | 1021 | 945 | 916 | 1042 |
---|
0.8 to 0.9 | 1041 | 1017 | 964 | 1039 | 976 |
---|
0.9 to 1.0 | 1001 | 1008 | 967 | 971 | 952 |
---|
Spread | 239 | 161 | 345 | 417 | 311 |
---|
Result | Passed | Passed | Passed | Passed | Passed |
---|
Maximum to Pass: 500 |
Sample Output27621 | 31190 | 4551 | 8276 | 19261 | 1573 | 1902 | 8278 | 2084 | 17366 | 5393 | 6454 | 31994 | 22381 | 27210 | 10698 | 31037 | 16096 | 29856 | 3599 | 21210 | 22260 | 12217 | 10727 | 16439 | 23126 | 19516 | 917 | 18173 | 13948 | 22919 | 27124 | 19366 | 21049 | 24086 | 17018 | 3530 | 8739 | 2734 | 15088 | 7465 | 9893 | 29773 | 23279 | 4983 | 12259 | 209 | 12570 | 7915 | 849 | 29290 | 6173 | 10630 | 16145 | 15809 | 20328 | 10532 | 5905 | 5861 | 25516 | 25668 | 18400 | 24826 | 8978 | 14230 | 23381 | 27808 | 6462 | 10313 | 6878 | 12580 | 20230 | 20243 | 19369 | 27753 | 18930 | 26621 | 4213 | 21909 | 1907 | 4852 | 3381 | 20091 | 28644 | 4367 | 10345 | 16331 | 32066 | 2721 | 1596 | 3067 | 4522 | 10750 | 6494 | 17652 | 14742 | 5902 | 26015 | 4221 | 21974 |
|