{"id":3891,"date":"2017-07-18T06:35:38","date_gmt":"2017-07-17T21:35:38","guid":{"rendered":"http:\/\/stuffy.dip.jp\/wordpress\/?p=3891"},"modified":"2017-07-18T06:35:38","modified_gmt":"2017-07-17T21:35:38","slug":"bugfiix-on-simultaneousequations-in-javascript","status":"publish","type":"post","link":"https:\/\/www.stuffy.site\/wordpress\/?p=3891","title":{"rendered":"\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d0\u30b0\u4fee\u6b63"},"content":{"rendered":"<p>\u904e\u53bb\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306eJavaScript\u306e\u9023\u7acb\u4e00\u6b21\u65b9\u7a0b\u5f0f\u306e\u89e3\u306e\u5206\u6570\u8868\u793a\u306e\u30d0\u30b0\u306e\u4ef6\u3067\u3057\u3070\u3089\u304f\u653e\u7f6e\u72b6\u614b\u3060\u3063\u305f\u3053\u3068\u3092\u304a\u8a6b\u3073\u7533\u3057\u4e0a\u3052\u307e\u3059\u3002\u8a73\u7d30\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3001<\/p>\n<p><a href=\"https:\/\/www.stuffy.site\/wordpress\/2017\/03\/01\/to-display-fractions\/\">\u5206\u6570\u306e\u8868\u793a<\/a><\/p>\n<p>\u5206\u5b50\u3068\u5206\u6bcd\u306e\u7d76\u5bfe\u5024\u3092\u3068\u3063\u3066\u304b\u3089\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u4e92\u9664\u6cd5\u3067\u6700\u5927\u516c\u7d04\u6570\u3092\u6c42\u3081\u3066\u3001\u5206\u6bcd\u304c\u30d7\u30e9\u30b9\u304b\u30de\u30a4\u30ca\u30b9\u304b\u3067\u6761\u4ef6\u5206\u5c90\u3057\u3066\u3001\u5206\u6bcd\u3068\u6700\u5927\u516c\u7d04\u6570\u304c\u7b49\u3057\u3044\u3068\u304d\uff08\u5206\u6bcd=1\u306e\u3068\u304d\u975e\u8868\u793a\uff09\u3001\u5206\u6bcd\u3068\u6700\u5927\u516c\u7d04\u6570\u304c\u7b49\u3057\u304f\u306a\u3044\u3068\u304d\u3092\u3001\u89e3\uff08x \u3068y\uff09\u3067\u305d\u308c\u305e\u308c\u3067\u6761\u4ef6\u5206\u5c90\u3057\u3066\u3001\u5206\u6bcd\u306b\u30de\u30a4\u30ca\u30b9\u304c\u3042\u308c\u3070\u7b26\u53f7\u5909\u63db\u3059\u308b\u30d5\u30ed\u30fc\u306b\u8003\u3048\u9055\u3044\u304c\u3042\u3063\u305f\u6a21\u69d8\u3002\uff08\u3061\u3087\u3063\u3068\u8003\u3048\u308c\u3070\u81ea\u660e\u3060\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u306d\u3002<\/p>\n<p>[pmath]z=ad-bc&lt;0[\/pmath]\u306e\u3068\u304d<\/p>\n<p>[pmath]x=-{dp-bq}\/{delim{|}{ad-bc}{|}}[\/pmath]<\/p>\n<p>[pmath]y=-{aq-cp}\/{delim{|}{ad-bc}{|}}[\/pmath]<\/p>\n<pre><span style=\"font-size: 9pt;\">var x1= d1*p1-b1*q1, y1 = a1*q1-c1*p1, z1 = a1*d1-b1*c1, x2 = Math.abs(x1), y2 = Math.abs(y1), z2 = Math.abs(z1);\n\nif(z1 &gt; 0) {\n\u3000if(gcdmemo(x2,z2) == z2) {\n\u3000\u3000document.getElementById('x').innerHTML = \"x = \" + x1\/gcdmemo(x2,z1);\n\u3000\u3000if(gcdmemo(y2,z2) == z2) {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + y1\/gcdmemo(y2,z1);\n\u3000\u3000}\n\u3000\u3000else {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + y1\/gcdmemo(y2,z1) + \"\/\" + z1\/gcdmemo(y2,z1) + \" = \" + y1\/z1;\n\u3000\u3000}\n\u3000}\n\u3000else {\n\u3000\u3000document.getElementById('x').innerHTML = \"x = \" + x1\/gcdmemo(x2,z1) + \"\/\" + z1\/gcdmemo(x2,z1) + \" = \" + x1\/z1;\n\u3000\u3000if(gcdmemo(y2,z2) == z2) {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + y1\/gcdmemo(y2,z1);\n\u3000\u3000}\n\u3000\u3000else {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + y1\/gcdmemo(y2,z1) + \"\/\" + z1\/gcdmemo(y2,z1) + \" = \" + y1\/z1;\n\u3000\u3000}\n\u3000}\n}\nelse {\n\u3000if(gcdmemo(x2,z2) == z2) {\n\u3000\u3000document.getElementById('x').innerHTML = \"x = \" + (-1)*x1\/gcdmemo(x2,z2);\n\u3000\u3000if(gcdmemo(y2,z2) == z2) {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + (-1)*y1\/gcdmemo(y2,z2);\n\u3000\u3000}\n\u3000\u3000else {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + (-1)*y1\/gcdmemo(y2,z2) + \"\/\" + z2\/gcdmemo(y2,z2) + \" = \" + y1\/z1;\n\u3000\u3000}\n\u3000}\n\u3000else {\n\u3000\u3000document.getElementById('x').innerHTML = \"x = \" + (-1)*x1\/gcdmemo(x2,z2) + \"\/\" + z2\/gcdmemo(x2,z2) + \" = \" + x1\/z1;\n\u3000\u3000if(gcdmemo(y2,z2) == z2) {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + (-1)*y1\/gcdmemo(y2,z2);\n\u3000\u3000}\n\u3000\u3000else {\n\u3000\u3000\u3000document.getElementById('y').innerHTML = \"y = \" + (-1)*y1\/gcdmemo(y2,z2) + \"\/\" + z2\/gcdmemo(y2,z2) + \" = \" + y1\/z1;\n\u3000\u3000}\n\u3000}\n}\n<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u904e\u53bb\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306eJavaScript\u306e\u9023\u7acb\u4e00\u6b21\u65b9\u7a0b\u5f0f\u306e\u89e3\u306e\u5206\u6570\u8868\u793a\u306e\u30d0\u30b0\u306e\u4ef6\u3067\u3057\u3070\u3089\u304f\u653e\u7f6e\u72b6\u614b\u3060\u3063\u305f\u3053\u3068\u3092\u304a\u8a6b\u3073\u7533\u3057\u4e0a\u3052\u307e\u3059\u3002\u8a73\u7d30\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3001 \u5206\u6570\u306e\u8868\u793a \u5206\u5b50\u3068\u5206\u6bcd\u306e\u7d76\u5bfe\u5024\u3092\u3068\u3063\u3066\u304b\u3089\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u4e92\u9664\u6cd5\u3067\u6700\u5927\u516c\u7d04 &hellip; <a href=\"https:\/\/www.stuffy.site\/wordpress\/?p=3891\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d0\u30b0\u4fee\u6b63<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[87,5],"tags":[],"class_list":["post-3891","post","type-post","status-publish","format-standard","hentry","category-javascript","category-software"],"_links":{"self":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3891"}],"version-history":[{"count":0,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3891\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}