Talk:Euclidean algorithm
User:MiszaBot/config Template:ArticleHistory Template:WikiProject banner shell
- REDIRECT Template:Archives
Inconsistent history
The present text of the article says that the Euclidean algorithm was first described in Europe by Bachet in 1624. This can hardly be true if it was already described in Euclid's Elements, which was known in Europe in various editions and translations long before Bachet.109.149.2.98 (talk) 13:49, 7 April 2019 (UTC)
- Point well taken. The source only says that Bachet gave the first numerical description of the algorithm in Europe. I'll edit this. --Bill Cherowitzo (talk) 19:02, 7 April 2019 (UTC)
Section "Non commutative rings"
It seems that the only known example is the ring of Hurwitz quaternions. This must be clarified. If is true, the section must be renamed "Hurwitz quaternions". Otherwise, it must be named "Non commutative Euclidean rings" and moved to Euclidean domain. D.Lazard (talk) 08:47, 18 June 2019 (UTC)
Inaccurate implementations
I feel the implementations given in the Implementations sections are all inaccurate. For example, gcd(-6, 0) is 6, but the implementations return -6. This is wrong because GCDs are always non-negative. Hexagonalpedia (talk) 12:18, 23 May 2021 (UTC)
Flowcharts
At least one flowchart that represents an Euclidean algorithm could be expected. Now no flowchart in the current article. So here are flowcharts.
As though there is no instruction modulo in computing, neither in Python nor in JavaScript for example, the first algorithm computes a remainder through successive subtractions. The second algorithm uses successive modulo operations — % in Python or in JavaScript —, in order to yield the GCD of two natural numbers. A little more complicated, the third algorith is conceived for the easiest mathematical proof of the existence of this “great” divisor, which is multiple of every common divisor of a given pair of natural numbers. This last algorithm keeps unchanged the common divisors of such a pair at every step, by replacing the greatest integer with the positive difference between the two.
is the other number, because zero is the only multiple
of every integer, the “greatest” for the divisibility.
These three algorithms could be inserted in introduction just after the text, while the antique diagram,
less comprehensible than a flowchart, could be transfered in section
“Background: greatest common divisor” on the right,
the rectangle being placed on the left.
All captions of this multiple image are
well presented in the first two available font‑sizes.
Arthur Baelde (talk) 14:28, 5 September 2024 (UTC)
- Flowcharts were a popular method for describing algorithms whent the main control instruction of programming languages was the "go to". Presently, flowcharts are generally replaced by pseudo-code, which is more concise, easier to understand because of its linear structure, and more powerful (it describes programs that cannot be described with flowcharts). The article Flowchart contains Template:Tqq
- Also, the manual of style of Wikipedia MOS:MATH#Algorithms says Template:Tqq, and does not mention flowcharts at all. Effectively, there are many Wikipedia articles that contain pseudocode, and very few that contain flowcharts.
- Presently, the section Template:Alink contains the pseudo-code of three versions of the Euclidean algorithm. The most complicate one consists of 7 short lines, and the third one can definitively not be converted into a flow chart. Also, the second one is a much better implementation than your thirs flowcharts.
- So, there is no reason for introducing flowcharts in this article, and, in any case, their place is not in the lead. D.Lazard (talk) 16:26, 5 September 2024 (UTC)
- I think it would be okay in principle to have a flowchart somewhere in this article, though an algorithm this simple can also be described as a paragraph or written as pseudocode.
- I find these particular flow charts pretty hard to read and visually distracting. The most important feature of flow charts is organizing information spatially so it can be easily visually scanned. –jacobolus (t) 17:16, 5 September 2024 (UTC)
Interactive worked examples
I've noticed that a lot of Wikipedia articles on algorithms have worked examples or sometimes GIF animations showing the algorithm step by step. I was thinking it would be cool if there could be an interactive worked example, where the reader can chose the inputs and then see the algorithm work step-by-step. I decided to have a go at trying to create something like that - see my demo on the right. I was wondering what people think of the idea? Bawolff (talk) 16:42, 14 November 2024 (UTC)
- I think this is fantastic. Unfortunately though, it doesn't show some of the numbers on dark mode, and doesn't work at all in the actual article for me. IAWW (talk) 21:08, 7 April 2025 (UTC)
- I think i fixed the dark mode issues. Can you describe what's happening for you in the article? Does it not show up at all? Does it show up but the buttons don't work? Bawolff (talk) 04:46, 9 April 2025 (UTC)
- @Bawolff Ah yes you have fixed the dark mode issues. Thank you!
- When I click the start button in the article it doesn't do anything. Interestingly, it works on Chrome (I just tested it). It only happens on Firefox when on the article itself, and there are no errors in the console. I wouldn't worry about it, maybe it is one of my extensions messing things up. IAWW (talk) 08:15, 9 April 2025 (UTC)
- Hmm, i tried on firefox and it seems to work for me. Hopefully its just a conflict with some other user script but i'll try and keep an eye out for anyone reporting a similar issue. Bawolff (talk) 10:27, 9 April 2025 (UTC)
- Great, must be something about my browser or scripts. Thanks for the great work! IAWW (talk) 11:22, 9 April 2025 (UTC)
- Hmm, i tried on firefox and it seems to work for me. Hopefully its just a conflict with some other user script but i'll try and keep an eye out for anyone reporting a similar issue. Bawolff (talk) 10:27, 9 April 2025 (UTC)
- I think i fixed the dark mode issues. Can you describe what's happening for you in the article? Does it not show up at all? Does it show up but the buttons don't work? Bawolff (talk) 04:46, 9 April 2025 (UTC)