Test whether a random number