{"provider_name":"Hatena Blog","width":"100%","blog_title":"Tbpgr Blog","height":"190","blog_url":"https://tbpgr.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftbpgr.hatenablog.com%2Fentry%2F20140906%2F1410009852\" title=\"Ruby | Numeric | divmod - Tbpgr Blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"categories":["Ruby"],"author_name":"tbpg","version":"1.0","provider_url":"https://hatena.blog","title":"Ruby | Numeric | divmod","url":"https://tbpgr.hatenablog.com/entry/20140906/1410009852","type":"rich","description":"\u6982\u8981 Numeric#divmod(other) -> [Numeric] \u8a73\u7d30 self \u3092 other \u3067\u5272\u3063\u305f\u6574\u6570\u306e\u5546 q \u3068\u4f59\u308a r \u3092\u8fd4\u5374\u3002\u5546\u306fNumeric#div \u4f59\u308a\u306fNumeric#modulo \u3068\u540c\u3058\u5024\u3002 \u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9 p 5.divmod(2) p 5 / 2 p 5.div(2) p 5 % 2 p 5.modulo(2) p 4.divmod(2) p 2.divmod(4) \u51fa\u529b $ ruby numeric_divmod.rb [2, 1] 2 2 1 1 [2, 0] [0, 2] \u53c2\u7167 http://docs.ruby-lang.org/ja/2.0.0/m\u2026","published":"2014-09-06 22:24:12","author_url":"https://blog.hatena.ne.jp/tbpg/"}