<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>fgshun</author_name>
  <author_url>https://blog.hatena.ne.jp/fgshun/</author_url>
  <blog_title>銀月の符号</blog_title>
  <blog_url>https://fgshun.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>今日、PythonRecipe に書いた182:最大公約数と最小公倍数を求める より。最大公約数をユークリッドの互除法にて算出する関数、非再帰版。この最後の部分 x, y = y, x % y が正しく動いてくれる幸せ。 def _gcd(x, y): u&quot;&quot;&quot; 最大公約数を求める。型チェック無し。 x, y が負の数の場合は正に変換してから計算する。 ユークリッドの互除法にて。 y が 0 ならば終了。最大公約数は x 。 x に y を代入。 y に x を y で割った余りを代入。繰り返し。 &quot;&quot;&quot; x = abs(x) y = abs(y) while y: x, y = y, x %…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffgshun.hatenablog.com%2Fentry%2F20080312%2F1205332591&quot; title=&quot;値の入れ替え - 銀月の符号&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-03-12 23:36:31</published>
  <title>値の入れ替え</title>
  <type>rich</type>
  <url>https://fgshun.hatenablog.com/entry/20080312/1205332591</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
