To visually confirm these results, several images were created
(see Figures 1-9). 256x256 pixel images were used to represent
the first 64K values of the array. Each 32-bit value was broken
into bytes, where byte 0 was used as the x-coordinate and byte 1
was used as the y-coordinate, with a white pixel drawn at this
coordinate. The image was initialized to black. The Windows
rand() function shows a low density of values in Image 1 and
patterns in Images 2 through 4, whereas Image 5 (15-bits per
call) appears more random, visually confirming issues displayed
in Table 1. Images 6 through 9 show ran2() which appears random
for 1-bit, 2-bit, 3 and 4-bits extracted per function call. The
implementation in Listing 1 has a subtle flaw. Functions ran0(),
ran1(), and ran2() generate a random number between 0.0
(inclusive) and 1.0 (exclusive) . This random number (0.0 to
almost 1.0) is then multiplied by 65535, causing the value of
65535 (0xffff) to not be generated. Tables 1 through 4 show
statistics for the following