Ok now I need to generate a really large random number, between 9000000000000000000 and 9999999999999999999. Now the rnd function on its own doesn't generate a small enough number to be useful in the situation. I multiplied three rnd number together to get an extremely tiny number.

The question:

Have I introduced any bias?

Here is the function:


MsgBox Len(Random("9000000000000000000", "9999999999999999999"))

Private Function Random(ByVal Min$, ByVal Max$) As Variant
Dim x, y, z
Randomize
x = CDec(Min): y = CDec(Max): z = CDec(Rnd) * CDec(Rnd) * CDec(Rnd)
Random = CDec(((y - x + 1) * z + x))
If InStr(1, Random, ".") Then Random = Left$(Random, InStr(1, Random, ".") - 1)
End Function