You could call rand twice to build your number, but that may not give a very uniform distribution.

Or you might use a different random number generator, e.g. the one described here:

http://www.math.keio.ac.jp/~matumoto/emt.html

Or you might use a different random number generator, e.g. the one described here:

http://www.math.keio.ac.jp