Implementation
Borland was once a very well known company in tech circles; their Turbo Pascal and C/C++ compilers were quite famous. Their compilers also came with distinctive controls, so you could always tell when software was developed using their tools. While they are no longer in business, they did leave a legacy behind.
In this case, their C/C++ compiler provided two
Linear Congruential Generators, each of which also featured a slight twist - they used a bit mask to return only a portion of the Seed value. This page is specifically for their lrand function, which returns only the last 30 bits of the Seed.
lrand uses the following constants in its generator:
- M = 231
- a = 22695477
- c = 1
Test Results
SEED | Number indicates how many results could be obtained before the generator fell into a loop. |
1138 | - | PASS |
65535 | - | PASS |
8675309 | - | PASS |
16777216 | - | PASS |
123456789 | - | PASS |
|
This generator produced an ideal distribution of outcomes. |
SEED | Minimum of 6,000 darts placed needed to pass. |
1138 | 6969 | PASS |
65535 | 7014 | PASS |
8675309 | 6971 | PASS |
16777216 | 6966 | PASS |
123456789 | 7003 | PASS |
SEED | 70% or higher required to pass. |
1138 | 101% | PASS |
65535 | 101% | PASS |
8675309 | 101% | PASS |
16777216 | 101% | PASS |
123456789 | 101% | PASS |
|
An ideal result for this test. |
385185846 | 78410943 | 226034322 | 586915499 | 479838219 | 327384412 | 161803906 | 474758078 | 365033677 | 541316625 | 759361973 | 877317169 | 410693193 | 23891378 | 557673512 | 130197947 | 299310248 | 942770755 | 428347935 | 1021068758 |
448942571 | 924251462 | 677006929 | 947261833 | 495722756 | 813114822 | 608978349 | 770080326 | 642361239 | 561672668 | 549268989 | 326643395 | 434357539 | 880389340 | 309260702 | 788606969 | 798171030 | 508687569 | 587762800 | 737878734 |
724114810 | 243544800 | 197529241 | 56458815 | 268529619 | 610592116 | 636964861 | 328762419 | 872279246 | 816936143 | 111017548 | 888845531 | 193954151 | 69573224 | 35456721 | 1061352993 | 689973886 | 1062630442 | 901395735 | 504267529 |
1464208 | 737033539 | 1006760884 | 658492752 | 256774659 | 215878914 | 661865629 | 107071026 | 1011255436 | 113059732 | 100641836 | 412708607 | 478034579 | 128133161 | 321888075 | 128181270 | 171808830 | 666387634 | 935400019 | 603984960 |
431898257 | 464701441 | 122015105 | 120303089 | 595918452 | 154672952 | 882351881 | 155065332 | 518933032 | 1023303785 | 826679225 | 834551542 | 490846384 | 856687608 | 289442006 | 774200421 | 294577972 | 696202952 | 617057443 | 1065906363 |
386020442 | 826966695 | 1048005146 | 801139484 | 131196443 | 332475611 | 920242171 | 1071073067 | 12105200 | 347858312 | 81661372 | 989491773 | 744944834 | 512747929 | 650236280 | 814467441 | 663648747 | 576390159 | 347560992 | 741148168 |
85810037 | 500077263 | 155402897 | 569715865 | 41859370 | 594665925 | 783077474 | 920940301 | 256341688 | 617675419 | 36560534 | 79680892 | 946328608 | 78015707 | 207028008 | 737306108 | 201192029 | 759035144 | 745781474 | 406218435 |
990861651 | 573739459 | 1053564150 | 384303142 | 565023998 | 1006393953 | 914656992 | 150633245 | 313040275 | 902554784 | 61907237 | 560186745 | 901191206 | 395607448 | 543114079 | 150829557 | 764043136 | 708442974 | 638971135 | 567070037 |
736166390 | 186716919 | 71398002 | 20453432 | 341739283 | 357303297 | 1010165710 | 819505191 | 626055570 | 745382830 | 339090058 | 179396678 | 561272730 | 105222608 | 313700110 | 706756463 | 142142692 | 102930013 | 146542720 | 688786483 |
95046329 | 220146198 | 405138129 | 740335749 | 143674316 | 796142495 | 778765322 | 772906704 | 240323570 | 717036914 | 78083563 | 485540421 | 714705605 | 695478518 | 388021596 | 839896750 | 99762008 | 661914542 | 1035633851 | 35691960 |
204578730 | 830340836 | 594355207 | 141062174 | 421019843 | 507502174 | 84192178 | 82402188 | 427419080 | 998348437 | 330862976 | 963486097 | 696385653 | 312478463 | 1006732261 | 648310060 | 657362480 | 960500153 | 352064659 | 895210153 |
1071226599 | 201862707 | 752068614 | 507907039 | 668356355 | 367725892 | 377809651 | 913490551 | 320404280 | 457696485 | 739843974 | 610380185 | 62803969 | 618145290 | 641637084 | 210876224 | 748843474 | 312233692 | 267236721 | 878974639 |
23259622 | 239822834 | 758125766 | 358539923 | 278234107 | 513125186 | 660502280 | 269326352 | 1033761017 | 307197475 | 737257787 | 885843790 | 1032693861 | 13314929 | 134779411 | 884534045 | 140070446 | 457109794 | 980100590 | 45388469 |
493616728 | 35263006 | 506051347 | 228794411 | 25349962 | 368227314 | 862084754 | 772609415 | 518280591 | 463340493 | 15277710 | 70137142 | 494661311 | 198993041 | 123672325 | 478755733 | 4190270 | 1021932781 | 127491700 | 912553276 |
316464464 | 293288477 | 910577891 | 1027729238 | 771937377 | 797911283 | 269234265 | 576959049 | 905785758 | 592749112 | 436354037 | 449877186 | 699112313 | 210629246 | 408991376 | 53790526 | 142004343 | 889868539 | 329039427 | 942595469 |
453770319 | 57310024 | 111270639 | 391059213 | 339135418 | 990218747 | 638433792 | 882351478 | 661116774 | 756314111 | 779802773 | 133768300 | 163251378 | 411152240 | 871350200 | 742999270 | 506089430 | 189824823 | 261020672 | 398828461 |
467397014 | 996644514 | 871121881 | 823774057 | 851440247 | 866773403 | 873563406 | 877712941 | 794662859 | 1009488913 | 465543189 | 1053607013 | 359093963 | 974905740 | 520140790 | 100854481 | 22918639 | 999052731 | 909704332 | 747217960 |
129553065 | 580855401 | 328975411 | 852974771 | 804876129 | 942631078 | 89417716 | 313094154 | 720223100 | 957408416 | 934256835 | 310139684 | 655032577 | 190391503 | 54365149 | 890638106 | 546034573 | 83818279 | 47878485 | 488561731 |
571077680 | 509570239 | 403245351 | 429903408 | 739091346 | 443844867 | 719454694 | 257664218 | 687938110 | 203516410 | 758771326 | 454838124 | 48171614 | 286700858 | 640324592 | 313197338 | 710752553 | 792795257 | 838387683 | 247316228 |
163106009 | 800979842 | 869859260 | 1059694408 | 479360280 | 225051245 | 455475538 | 1024449639 | 491468674 | 36471357 | 168465760 | 842825401 | 476162976 | 431831190 | 924398944 | 986734255 | 589433707 | 344196262 | 22219716 | 996140026 |