You have at least a 48-bit random number generator, so count yourself lucky. Even so, if you change your 40 to a 49, you might find that all twenty of your values are even numbers, as it is on my machine. So taking the number modulo a few billion leaves you with potential skewings of about one part in 65,000 or so. That's good enough for many, but not all,
applications.