{"image_url":null,"provider_name":"Hatena Blog","width":"100%","categories":["Python"],"provider_url":"https://hatena.blog","url":"https://fgshun.hatenablog.com/entry/20080312/1205332591","title":"\u5024\u306e\u5165\u308c\u66ff\u3048","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffgshun.hatenablog.com%2Fentry%2F20080312%2F1205332591\" title=\"\u5024\u306e\u5165\u308c\u66ff\u3048 - \u9280\u6708\u306e\u7b26\u53f7\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","published":"2008-03-12 23:36:31","author_name":"fgshun","description":"\u4eca\u65e5\u3001PythonRecipe \u306b\u66f8\u3044\u305f182:\u6700\u5927\u516c\u7d04\u6570\u3068\u6700\u5c0f\u516c\u500d\u6570\u3092\u6c42\u3081\u308b \u3088\u308a\u3002\u6700\u5927\u516c\u7d04\u6570\u3092\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u306e\u4e92\u9664\u6cd5\u306b\u3066\u7b97\u51fa\u3059\u308b\u95a2\u6570\u3001\u975e\u518d\u5e30\u7248\u3002\u3053\u306e\u6700\u5f8c\u306e\u90e8\u5206 x, y = y, x % y \u304c\u6b63\u3057\u304f\u52d5\u3044\u3066\u304f\u308c\u308b\u5e78\u305b\u3002 def _gcd(x, y): u\"\"\" \u6700\u5927\u516c\u7d04\u6570\u3092\u6c42\u3081\u308b\u3002\u578b\u30c1\u30a7\u30c3\u30af\u7121\u3057\u3002 x, y \u304c\u8ca0\u306e\u6570\u306e\u5834\u5408\u306f\u6b63\u306b\u5909\u63db\u3057\u3066\u304b\u3089\u8a08\u7b97\u3059\u308b\u3002 \u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u306e\u4e92\u9664\u6cd5\u306b\u3066\u3002 y \u304c 0 \u306a\u3089\u3070\u7d42\u4e86\u3002\u6700\u5927\u516c\u7d04\u6570\u306f x \u3002 x \u306b y \u3092\u4ee3\u5165\u3002 y \u306b x \u3092 y \u3067\u5272\u3063\u305f\u4f59\u308a\u3092\u4ee3\u5165\u3002\u7e70\u308a\u8fd4\u3057\u3002 \"\"\" x = abs(x) y = abs(y) while y: x, y = y, x %\u2026","type":"rich","blog_url":"https://fgshun.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/fgshun/","blog_title":"\u9280\u6708\u306e\u7b26\u53f7"}