I would like to generate a random 20-digit number using R.
My first attempt was to do
runif(1,10000000000000000000,9999999999999999999)
But this doesn't seem to work because R keeps rounding the 9999999999999999999 to 10000000000000000000. It doesn't seem to accept a "9999" number until I go down to 15 digits:
> 9999999999999999999
[1] 10000000000000000000
> 999999999999999999
[1] 1000000000000000000
> 99999999999999999
[1] 100000000000000000
> 9999999999999999
[1] 10000000000000000
> 999999999999999
[1] 999999999999999
> 99999999999999
[1] 99999999999999
> 9999999999999
[1] 9999999999999
Is there a better way to approach this?