Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!grace.cs.washington.edu!luong From: luong@grace.cs.washington.edu (Luong La) Newsgroups: comp.lang.c Subject: 35bits random generator Summary: Full period 2^35-31 (MSC5.1) Message-ID: <7217@june.cs.washington.edu> Date: 9 Feb 89 04:44:34 GMT Sender: news@june.cs.washington.edu Reply-To: luong@grace.UUCP (Luong La) Organization: Ugrad-Instr CS Dept., UW, Seattle Lines: 16 Many msgs were concerning with rand(), so here one of the rand35() I used. note: MSC5.1 had fmod function -> floatingpoint modulo #include static double z35=0.00001; double rand35() { z35 = fmod(3125.0*z35,34359738340.0); return z35;} /* normalize -> [0,1] */ double nrand35() {return (rand35()/3435973839.0);} credits: I copied this generator from some where and I believed it calls ===RLab===Epsilon task takes infinite time=== luong@grace.cs.washington.edu