rand(1:10) vs Int(round(10*rand())

julia> 10^16 == Float64(10^16)
true

The problem is that rand(Float64) effectively generates random fixed-point numbers and then converts them to floats. See https://discourse.julialang.org/t/output-distribution-of-rand/12192.