GMP and MPFR have random number generator functions.
However, they are not currently exposed to julia.
It seems like they should be, as generating random numbers correctly is hard.
Making sure srand works properly may take some doing.
(from https://stackoverflow.com/questions/47628275/random-bigfloats-julia)
Update: I see now rand(BigFloat) works on master, but not rand(BigInt)
Do you request specifically the random generation provided by those libraries? If so, see https://github.com/JuliaLang/julia/pull/13950 for BigFloat, I would be willing to contribute finishing this work. For GMP, a similar work would be quite easy. But it's unlikely that those belong to Base, in particular as the functionality is already implemented in pure Julia (for BigFloat I guess it's only on 0.7).
No, not using those libraries I was just observing they exist.
Implementing directly in julia seems completely reasonable.
I see that rand(BigFloat) does work on master.
I only checked rand(BigInt) and I just assumed rand(BigFloat) was not working either. My bad.
And rand(BigInt) can't exist (if you want a uniform distribution) because this type is unbounded. One the other hand, what has been available for a while is rand(::UnitRange{BigInt}). So I will close.
Oh of-course it can't.
I really didn't think this one through. :-S
I was thinking since rand(Int) works rand(BigInt) should too.
But you are right. It can't.
It could check how much memory you have and generate a random integer between ±2^((size of RAM) >> 1). But I suspect that might not be the most popular method definition ever :trollface:
Most helpful comment
It could check how much memory you have and generate a random integer between
±2^((size of RAM) >> 1). But I suspect that might not be the most popular method definition ever :trollface: