Просмотр исходного кода

2003-11-20 Ben Maurer <[email protected]>

	* BigInteger.cs: Fix prob. prime test for small numbers (Pieter Philippaerts)

svn path=/trunk/mcs/; revision=20295
Ben Maurer 22 лет назад
Родитель
Сommit
a337a00a9d
2 измененных файлов с 6 добавлено и 2 удалено
  1. 2 2
      mcs/class/corlib/Mono.Math/BigInteger.cs
  2. 4 0
      mcs/class/corlib/Mono.Math/ChangeLog

+ 2 - 2
mcs/class/corlib/Mono.Math/BigInteger.cs

@@ -723,7 +723,7 @@ namespace Mono.Math {
 
 			for (int p = 0; p < smallPrimes.Length; p++) {
 				if (this % smallPrimes [p] == 0)
-					return false;
+					return this == smallPrimes [p];
 			}
 
 			return
@@ -736,7 +736,7 @@ namespace Mono.Math {
 
 			for (int p = 0; p < smallPrimes.Length; p++) {
 				if (this % smallPrimes [p] == 0)
-					return false;
+					return this == smallPrimes [p];
 			}
 
 			return

+ 4 - 0
mcs/class/corlib/Mono.Math/ChangeLog

@@ -1,3 +1,7 @@
+2003-11-20 Ben Maurer  <[email protected]>
+
+	* BigInteger.cs: Fix prob. prime test for small numbers (Pieter Philippaerts)
+
 2003-06-11  Sebastien Pouliot <[email protected]>
 
 	* BigInteger.cs: Added Clear to zeroize big integers and code to allow