Skip to content

Commit

Permalink
Fix for Cppia (see issue HaxeFoundation#11897)
Browse files Browse the repository at this point in the history
  • Loading branch information
flashultra committed Dec 20, 2024
1 parent 3696602 commit 3ec3f61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions std/haxe/math/bigint/BigInt_.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,9 @@ class BigInt_ {
private function modInverse32(d:Int):Int32 {
var x:Int32;
x = d + (((d + 1) & 4) << 1);
x = x * (2 - (d * x));
x = x * (2 - (d * x));
x = x * (2 - (d * x));
x = (2 - (d * x)) * x;
x = (2 - (d * x)) * x;
x = (2 - (d * x)) * x;
return x;
}

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/src/unit/TestBigInt.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2747,9 +2747,9 @@ class TestBigInt extends Test {
eq("692421",a.max(b).toString());
}

#if (!lua && !cppia)
public function testNextProbablePrime():Void
{
#if (!lua && !cppia)
var a:BigInt;
a = "8329132432461";
eq("8329132432469",a.nextProbablePrime().toString());
Expand All @@ -2765,8 +2765,8 @@ class TestBigInt extends Test {
eq("40870721",a.nextProbablePrime().toString());
a = 32747015;
eq("32747023",a.nextProbablePrime().toString());
#end
}
#end

public function testBigIntRandom():Void
{
Expand All @@ -2778,9 +2778,9 @@ class TestBigInt extends Test {
}
}

#if (!lua && !cppia)
public function testBigIntRandomPrime():Void
{
#if (!lua && !cppia)
var randomPrimeNumber:BigInt = BigInt.randomPrime(5,5);
t(randomPrimeNumber.isProbablePrime(5));
randomPrimeNumber = BigInt.randomPrime(11,5);
Expand All @@ -2795,8 +2795,8 @@ class TestBigInt extends Test {
t(randomPrimeNumber.isProbablePrime(5));
randomPrimeNumber = BigInt.randomPrime(156,5);
t(randomPrimeNumber.isProbablePrime(5));
#end
}
#end

public function testBigIntRandomInRange():Void
{
Expand Down

0 comments on commit 3ec3f61

Please sign in to comment.