added RAND_MAX compatibility test