File tree 5 files changed +30
-5
lines changed
5 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
<PropertyGroup >
4
4
<OutputType >Exe</OutputType >
5
- <TargetFramework >net8 .0</TargetFramework >
5
+ <TargetFramework >net9 .0</TargetFramework >
6
6
<ImplicitUsings >enable</ImplicitUsings >
7
7
<Nullable >enable</Nullable >
8
8
<NoWarn >CA1822;</NoWarn >
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFrameworks >netstandard2.0;netstandard2.1;net7.0;net8.0</TargetFrameworks >
4
+ <TargetFrameworks >netstandard2.0;netstandard2.1;net7.0;net8.0;net9.0; </TargetFrameworks >
5
5
<LangVersion >latest</LangVersion >
6
6
<Nullable >enable</Nullable >
7
7
<ImplicitUsings >enable</ImplicitUsings >
20
20
<PackageProjectUrl >https://github.com/Open-NET-Libraries/Open.Numeric.Primes/</PackageProjectUrl >
21
21
<RepositoryUrl >https://github.com/Open-NET-Libraries/Open.Numeric.Primes/</RepositoryUrl >
22
22
<RepositoryType >git</RepositoryType >
23
- <Version >4.0.2 </Version >
23
+ <Version >4.0.3 </Version >
24
24
<PackageReleaseNotes ></PackageReleaseNotes >
25
25
<PackageLicenseExpression >MIT</PackageLicenseExpression >
26
26
<PublishRepositoryUrl >true</PublishRepositoryUrl >
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
<PropertyGroup >
3
3
<OutputType >Exe</OutputType >
4
- <TargetFramework >net8 .0</TargetFramework >
4
+ <TargetFramework >net9 .0</TargetFramework >
5
5
<LangVersion >latest</LangVersion >
6
6
</PropertyGroup >
7
7
<ItemGroup >
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFramework >net8 .0</TargetFramework >
4
+ <TargetFramework >net9 .0</TargetFramework >
5
5
<LangVersion >latest</LangVersion >
6
6
<IsPackable >false</IsPackable >
7
7
</PropertyGroup >
Original file line number Diff line number Diff line change 1
1
using FluentAssertions ;
2
+ using Open . Numeric . Primes . Extensions ;
2
3
using System ;
3
4
using System . Collections . Generic ;
4
5
using System . Collections . Immutable ;
@@ -375,4 +376,28 @@ public static void PrimeFactors_BigInt()
375
376
) ;
376
377
}
377
378
}
379
+
380
+ [ Theory ]
381
+ [ InlineData ( 9223372036854775783UL ) ]
382
+ [ InlineData ( 9223372036854775837UL ) ]
383
+ [ InlineData ( 9223372036854775907UL ) ]
384
+ public static void MillerRabinKnownLargeProbablePrimes ( ulong number )
385
+ => MillerRabin . IsProbablePrime ( number ) . Should ( ) . BeTrue ( ) ;
386
+
387
+ [ Theory ]
388
+ [ InlineData ( 9223372036854775783UL ) ]
389
+ [ InlineData ( 9223372036854775837UL ) ]
390
+ [ InlineData ( 9223372036854775907UL ) ]
391
+ public static void KnownLargePrimes ( ulong number )
392
+ => number . IsPrime ( ) . Should ( ) . BeTrue ( ) ;
393
+
394
+ [ Fact ]
395
+ public static void MillerRabinTest ( )
396
+ {
397
+ foreach ( var p in FirstKnownInt32 . Select ( i => ( ulong ) i ) )
398
+ MillerRabin . IsPrime ( p ) . Should ( ) . BeTrue ( ) ;
399
+
400
+ foreach ( var p in FirstNotInt32 . Select ( i => ( ulong ) i ) )
401
+ MillerRabin . IsPrime ( p ) . Should ( ) . BeFalse ( ) ;
402
+ }
378
403
}
You can’t perform that action at this time.
0 commit comments