next up previous

Exercise 6: Cray's LCG ranf()

On a Cray supercomputer running UNICOS, obtain the manual page on its intrinsic random number generator by typing at the UNICOS prompt (%) `` man ranf > ranf.doc''. Read the file ranf.doc to see how to set and get the seed for ranf. Given that ranf is a multiplicative, congruential generator (c = 0) using 46 bits - get the initial seed; discuss it in terms of cycle length. Set the seed to 1, and call ranf to obtain a new seed. Get and print out the new seed; this new seed is the multiplier of the generator. Discuss the multiplier in the context of the cycle length. Print out the first ten random integers in decimal and hexadecimal format, and the corresponding random real numbers using an f20.16 format.