numbersit is probably best to set so that the same random sequence occurs all the time when the program seems to workeither the system clock can be used or the user can be asked to input value for the seed it is also common to return random real number in the open interval ( ( and are not possible values)this can be done by dividing by from thisa random number in any closed interval [abcan be computed by normalizing this yields the "obviousclass in figure whichunfortunatelyis erroneous the problem with this class is that the multiplication could overflowalthough this is not an errorit affects the result and thus the pseudorandomness even though we could use -bit long longsthis could slow down the computation schrage gave procedure in which all the calculations can be done on -bit machine without overflow we compute the quotient and remainder of / and define these as and rrespectively in our caseq , , and we have axi xi+ axi mod axi xi xi axi axi + - xi axi xi + axi since xi xqi xi mod qwe can replace the leading axi and obtain xi axi xi xi xi mod + xi+ xi xi axi (aq ma(xi mod qm since aq rit follows that aq - thuswe obtain xi xi axi + xi+ (xi mod qr the term (xi xqi ax is either or because both terms are integers and their difference lies between and thuswe have xi xi+ (xi mod qr md(xi quick check shows that because qall the remaining terms can be calculated without overflow (this is one of the reasons for choosing , furthermored(xi only if the remaining terms evaluate to less than zero thus (xi does not need to be explicitly computed but can be determined by simple test this leads to the revision in figure one might be tempted to assume that all machines have random-number generator at least as good as the one in figure in their standard library sadlythis is not true many libraries have generators based on the function