In the last "return()" in the function genrand(), (double)y is divided by (unsigned long)0xffffffff, i.e. 2^32-1. If you change this to 2^32, the output is distributed in [0,1). How to construct the real constant 2^32 depends on your system, but for example
double zzz = ((double)((unsigned long) 0x80000000))*2;
sets the real 2^32 into zzz. We guess there is a smarter way: let us know.
A master course student Sin Tanaka at the electoric engineering department of Keio University suggested to obtain a real 2^{-32} as a real constant. The corresponding code is included on the main page.
(2002/Jan.8th added) Isaku Wada gave a nice comment on this. For [0,1], replace the last return with
return y*(1.0/4294967295.0); /* reals */
and for [0,1), replace the last return with
return y*(1.0/4294967296.0); /* reals: [0,1)-interval */
Since most compilers compute the constant when it is compiled, so this code runs with the same speed with the standard C codes, and portability and readability are better.