Explorar o código

correction test dicreteLog

Olivier Marty %!s(int64=8) %!d(string=hai) anos
pai
achega
b6c082e018
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      code/DiscreteLog_test.cpp

+ 2 - 1
code/DiscreteLog_test.cpp

@@ -14,7 +14,8 @@ int main() {
     int a = rand()%5000;
     int b = rand()%5000;
     int n = rand()%5000;
+    b %= n;
     int r = log_mod(a, b, n);
-    assert(r == -1 || pow_mod(a, r, n) == b%n);
+    assert(r == -1 || pow_mod(a, r, n) == b);
   }
 }