linear congruential generator from BSD and MS C runtime