void Prime() { Assert.True(MillerRabin.IsPrime(2)); Assert.True(MillerRabin.IsPrime(3)); Assert.True(MillerRabin.IsPrime(11)); Assert.True(MillerRabin.IsPrime(100003)); Assert.True(MillerRabin.IsPrime(679067)); Assert.True(MillerRabin.IsPrime(1000000007)); Assert.True(MillerRabin.IsPrime(1000000000000000003)); var e64 = "10000000000000000000000000000000000000000000000000000000000000057"; Assert.True(MillerRabin.IsPrime(BigInteger.Parse(e64))); //素数大富豪 var primeMillionaire = "99998888777766665555444433332222131313131313121212121111111011010101111"; Assert.True(MillerRabin.IsPrime(BigInteger.Parse(primeMillionaire))); //メルセンヌ素数 var mersennePrime12th = BigInteger.Pow(2, 127) - 1; Assert.True(MillerRabin.IsPrime(mersennePrime12th)); }