rand$m (2) --- generate a random number 04/27/83 | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n | longreal function rand$m (l) | longint l | Library: vswtmath (Subsystem mathematical library) | _F_u_n_c_t_i_o_n | The 'rand$m' function returns a double precision floating | value in the open interval (0.0, 1.0). The argument to the | function is set to a 32 bit integer in the range (0, 2**31 - | 1). The generator is a linear congruential generator with | multiplier 764261123. The values returned seem to be very | well distributed, both from the standpoint of spectral tests | and lattice tests. | The 'rand$m' routine does not detect or signal any errors. | The first time the 'rand$m' function is called, if the | generator has not been initialized with the 'seed$m' | procedure, a seed is derived based on the current time of | day and cpu utilization. This seed is returned in the | integer argument variable. | This function can serve as a single precision function | although it returns a double precision result. The function | has been coded so that any value returned will not overflow | or underflow a single precision floating point value. The | double precision register overlaps the single precision | register so it is possible to declare and use this function | as simply a "real" function. | _I_m_p_l_e_m_e_n_t_a_t_i_o_n | Derived from information presented in "A Statistical Evalua- | tion of Multiplicative Congruential Random Number Generators | with Modulus 2^32 -1" by George S. Fishman and Louis R. | Moore, in the Journal of the American Statistical | Association, volume 77, number 377, March 1982. | _C_a_l_l_s | dble$m, Primos timdat | _S_e_e _A_l_s_o | dble$m (2), seed$m (2), | _S_W_T _M_a_t_h _L_i_b_r_a_r_y _U_s_e_r_'_s _G_u_i_d_e rand$m (2) - 1 - rand$m (2)