Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ISC_122 - Travail Pratique 001 - Code de Reed-Solomon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
florian.burgener
ISC_122 - Travail Pratique 001 - Code de Reed-Solomon
Commits
53507693
Commit
53507693
authored
3 years ago
by
quentin.fasler
Browse files
Options
Downloads
Patches
Plain Diff
edit modular_inverse
parent
032a0098
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
polynomial.py
+5
-10
5 additions, 10 deletions
polynomial.py
with
5 additions
and
10 deletions
polynomial.py
+
5
−
10
View file @
53507693
...
...
@@ -122,16 +122,11 @@ def compute_bachet_bezout(a, b):
def
modular_inverse
(
a
,
n
):
res
=
-
1
inverse
=
-
1
i
=
0
while
res
!=
1
:
if
a
*
i
%
n
==
1
:
res
=
a
*
i
%
n
inverse
=
i
break
i
+=
1
return
inverse
bachet_bezout
=
compute_bachet_bezout
(
a
,
n
)
modular_inverse
=
bachet_bezout
[
0
]
if
a
*
modular_inverse
%
n
==
1
:
return
modular_inverse
return
None
def
compute_lagrange_polynomial
(
points
,
prime_number
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment