openGPMP
Open Source Mathematics Package
nt_ex.py
Go to the documentation of this file.
1 #!/usr/bin/python3
2 from pygpmp import nt
3 
4 
5 def main():
6  p = nt.PrimalityTest()
7 
8  prime_0 = p.is_prime(2999)
9  prime_1 = p.carmichael_num(561)
10  print(prime_0)
11  print(prime_1)
12 
13  mod_0 = p.mod_pow(3, 2, 2)
14  mod_1 = p.mod_pow(5, 2, 7)
15  print(mod_0)
16  print(mod_1)
17 
18  p.miller_rabin(4, 4, 200)
19 
20  ss_0 = p.solovoy_strassen(15, 50)
21  ss_1 = p.solovoy_strassen(1049, 50)
22  print(ss_0)
23  print(ss_1)
24 
25 
26 if __name__ == "__main__":
27  main()
def main()
Definition: nt_ex.py:5