But if you get a perfect square, then you are left with a rational number.
I suppose you could generate a random integer and then run an algorithm.
If square root is rational, then use cube root. If cube root is rational, then…
Of course, you're screwed if your random integer happens to be 0 or 1. Negative numbers could cause problems too, but you can error-trap that.