• R/O
  • SSH

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A small kernel of code for playing with Galois fields of arbitrary characteristic


Commit MetaInfo

Revisionf08e01af6b80b197a203f3c61b449905829e011d (tree)
Zeit2021-07-19 05:32:33
AutorEric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Fix comment. (Why did I use '' and not '*'?!?)

Ändern Zusammenfassung

Diff

diff -r 54f6125563fe -r f08e01af6b80 numtheory_utils.py
--- a/numtheory_utils.py Sun Mar 28 15:42:16 2021 -0700
+++ b/numtheory_utils.py Sun Jul 18 13:32:33 2021 -0700
@@ -7,13 +7,15 @@
77
88 def extended_gcd(x: int, y: int):
99 """Return a tuple 't' with three elements such that:
10- t[0) * x + t[1] * y == t[2]
10+ t[0] * x + t[1] * y == t[2]
1111
1212 t[2] will be either 0 or 1. If it is zero, then x and y are not
1313 relatively prime. If it is one, then they are.
1414
1515 This makes use of Euclid's algorithm for finding the GCD, but extends it
1616 to keep track of the extra data returned in t[0] and t[1].
17+
18+ GCD = Greatest Common Denominator
1719 """
1820 sx = 1 if x > 0 else -1
1921 x = abs(x)