[Mono-bugs] [Bug 76488][Maj] New - System.Random().Next() and System.Random().NextDouble() generate the same consecutive random numbers

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Oct 19 23:22:37 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by aeyakovenko at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76488

--- shadow/76488	2005-10-19 23:22:36.000000000 -0400
+++ shadow/76488.tmp.8119	2005-10-19 23:22:36.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 76488
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: gentoo 2.6.12.5
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: aeyakovenko at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Random().Next() and System.Random().NextDouble()  generate the same consecutive random numbers
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing. 
+Description of Problem: 
+ 
+when generating lots of consecutive random numbers Next() and NextDouble() 
+generate the same number.  Here is some nemerle code: 
+ 
+using Nemerle.Collections.List; 
+using Nemerle.IO; 
+ 
+def random(times, acc) { 
+   match(times) { 
+      |0 => acc 
+      |t => random(t - 1, System.Random().NextDouble()::acc) 
+   } 
+} 
+def randlist = random(100, []); 
+Map(randlist, fun(a) { print("$(a)\n"); }) 
+ 
+Steps to reproduce the problem: 
+create a list of numbers in a loop with System.Random().NextDouble() 
+print the list 
+ 
+Actual Results: 
+large consecutive chunks of numbers are the same 
+ 
+Expected Results: 
+each number should be different 
+ 
+How often does this happen?  
+every time 
+ 
+ 
+Additional Information:


More information about the mono-bugs mailing list