[Mono-bugs] [Bug 76488][Maj] Changed - 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
Thu Oct 20 06:32:28 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 matze at braunis.de.

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

--- shadow/76488	2005-10-19 23:22:36.000000000 -0400
+++ shadow/76488.tmp.12170	2005-10-20 06:32:28.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 76488
 Product: Mono: Class Libraries
 Version: 1.1
-OS: 
+OS: unknown
 OS Details: gentoo 2.6.12.5
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: System
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: aeyakovenko at gmail.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -47,6 +47,15 @@
  
 How often does this happen?  
 every time 
  
  
 Additional Information:
+
+------- Additional Comments From matze at braunis.de  2005-10-20 06:32 -------
+I don't know nemerle syntax, but this looks to me like you're creating
+a new instance of the Random object for each number. This won't work
+well as Random is initialized with the current time (in seconds
+granularity) as seed. So you'll get the same number for 1 second.
+
+The correct usage would be to create 1 random object and then reuse it
+for all numbers.


More information about the mono-bugs mailing list