{"id":143,"date":"2011-10-12T11:12:28","date_gmt":"2011-10-12T16:12:28","guid":{"rendered":"http:\/\/thenoyes.com\/littlenoise\/?p=143"},"modified":"2011-10-12T11:12:28","modified_gmt":"2011-10-12T16:12:28","slug":"greatest-common-denominator","status":"publish","type":"post","link":"https:\/\/thenoyes.com\/littlenoise\/?p=143","title":{"rendered":"Greatest Common Denominator"},"content":{"rendered":"<p>Find the greatest common factor of two positive integers.<\/p>\n<pre>CREATE FUNCTION gcd(x int, y int) RETURNS int DETERMINISTIC\r\nBEGIN\r\n  DECLARE dividend int;\r\n  DECLARE divisor int;\r\n  DECLARE remainder int;\r\n  SET dividend := GREATEST(x, y);\r\n  SET remainder := LEAST(x, y);\r\n\r\n  WHILE remainder != 0 DO\r\n    SET divisor = remainder;\r\n    SET remainder = MOD(dividend, divisor);\r\n    SET dividend = divisor;\r\n  END WHILE;\r\n\r\n  RETURN divisor;\r\nEND<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Find the greatest common factor of two positive integers. CREATE FUNCTION gcd(x int, y int) RETURNS int DETERMINISTIC BEGIN DECLARE dividend int; DECLARE divisor int; DECLARE remainder int; SET dividend := GREATEST(x, y); SET remainder := LEAST(x, y); WHILE remainder != 0 DO SET divisor = remainder; SET remainder = MOD(dividend, divisor); SET dividend = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2IBF1-2j","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":2,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions\/145"}],"wp:attachment":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}