Start writing inverse.py
This commit is contained in:
parent
96415e423e
commit
6c961b7572
2 changed files with 20 additions and 0 deletions
|
@ -42,6 +42,8 @@ def calculate(a, b):
|
|||
print_table(r, u, v, q)
|
||||
print("Le PGCD est", r[-2])
|
||||
|
||||
return u[-1]
|
||||
|
||||
|
||||
def print_table(r, u, v, q):
|
||||
"""Représentation de l'algorithme"""
|
||||
|
|
18
algebre-non-lineaire/inverse.py
Normal file
18
algebre-non-lineaire/inverse.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""Algorithme de calcul de l'inverse d'un ensemble
|
||||
|
||||
Utilise les coefficients de Bezout donnés par l'algorithme d'Euclide étendu.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import euclide_etendu
|
||||
|
||||
|
||||
def main()
|
||||
if len(sys.argv) == 3:
|
||||
a = int(sys.argv[1])
|
||||
n = int(sys.argv[2])
|
||||
else:
|
||||
a = int(input("a : "))
|
||||
n = int(input("n : "))
|
Loading…
Reference in a new issue