[Mono-bugs] [Bug 81857][Nor] Changed - BigInteger.IsProbablePrime() fails on some primes

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jul 4 08:58:00 EDT 2007

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 sebastien at ximian.com.


--- shadow/81857	2007-07-03 12:26:03.000000000 -0400
+++ shadow/81857.tmp.21798	2007-07-04 08:58:00.000000000 -0400
@@ -61,6 +61,18 @@
 which may not be a bug (as the method is called IsProbablePrime and
 can refuse valid prime ;-)
 ------- Additional Comments From sebastien at ximian.com  2007-07-03 12:26 -------
 The IndexOutOfRangeException is fixed in SVN r81272.
 This was due to typecasting an negative int to an uint without a check.
+------- Additional Comments From sebastien at ximian.com  2007-07-04 08:57 -------
+Kazuki is right, there's something wrong happening when calling OddPow.
+I've replaced (r81329) the multiple code paths with a simpler one
+(square and multiply) and the problem doesn't occurs as much (and only
+for small numbers of about 20 digits). 
+I've added a bunch of the primes, from the provided URL, to our unit
+test suite (r81330).
+Keeping the issue open...

More information about the mono-bugs mailing list