• R/O
  • SSH

提交

标签

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

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


Commit MetaInfo

修订版f08e01af6b80b197a203f3c61b449905829e011d (tree)
时间2021-07-19 05:32:33
作者Eric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

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

更改概述

差异

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)