static const int static const int static const int astatic const int /*return pseudorandom intand change the internal state *int random::randomintint tmpstate state state )iftmpstate > state tmpstateelse state tmpstate mreturn statefigure random-number modification that does not overflow on -bit machines xi+ (axi cmod where is chosen to match the number of bits in the machine' integerand and are odd unfortunatelythese generators always produce values of xi that alternate between even and odd--hardly desirable property indeedthe lower bits cycle with period (at bestmany other random-number generators have much smaller cycles than the one provided in figure these are not suitable for the case where long sequences of random numbers are needed the unix drand function uses generator of this form howeverit uses -bit linear congruential generator and returns only the high bitsthus avoiding the cycling problem in the low-order bits the constants are , , , and ++ provides very general framework for the generation of random numbers in this frameworkthe generation of random numbers ( the type of random-number generator usedis separated from the actual distribution used ( whether the numbers are uniformly distributed over integersa range of realsor follow other distributionssuch as the normal distribution or poisson distributionthe generators that are provided include linear-congruential generatorswith the class template linear_congruential_enginewhich allows the specification of the parameters acand template class linear congruential engine