[Mono-bugs] [Bug 68452][Min] New - BigInteger.Randomize doesn't work if BigInteger.BitCount == 0

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 16 Oct 2004 16:51:26 -0400 (EDT)


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 pieter@mentalis.org.

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

--- shadow/68452	2004-10-16 16:51:26.000000000 -0400
+++ shadow/68452.tmp.1500	2004-10-16 16:51:26.000000000 -0400
@@ -0,0 +1,28 @@
+Bug#: 68452
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 001 One hour
+Priority: Minor
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: pieter@mentalis.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: BigInteger.Randomize doesn't work if BigInteger.BitCount == 0
+
+The BigInteger.Randomize throws an ArrayOutOfBounds exception if the 
+BigInteger in question has a bitcount of 0.
+
+BigInteger bi = new BigInteger();
+bi.Randomize(); // blows up
+
+
+Also, should the BitCount method ever return zero? Does a 0-bit integer 
+make sense? If the value of the integer in question is zero, I would let 
+the BitCount method return '1'.