added a function for retrieving rands as a double

Implemented 'm_rand_nextd' for obtaining a random numbers a double between
zero and one.