// math.ii /** * Return the minimum of x and y. */ min(x:int, y:int):int /** * Return the maximum of x and y. */ max(x:int, y:int):int /** * Return the absolute value of x. */ abs(x:int):int /** * Return x^y. */ pow(x:int, y:int):int /** * Seed the random number generator. * A common way to do this is with the time() function: * srand(time()) * * Precondition: none * Postcondition: The random number generator * will use seed to generate the next * random number. */ srand(seed:int) /** * A pseudo-random number generator. * * Precondition: srand has been called at least once. * Postcondition: The next pseudo-random number will be * returned. The number will be in the range [0, 2^31 - 1). * * The algorithm used is a linear congruential generator as * defined by [Lehmner, 1951]. The variant implemented here * is widely used and described in [Lewis et al., 1969]. * * The period of this generator (the number of numbers it can * produce before cycling back and repeating numbers) is * P = 2^31 - 2 */ rand():int