{"blog_title":"Camera Obscura","type":"rich","url":"https://obelisk.hatenablog.com/entry/2016/08/16/233516","height":"190","description":"Ruby\u306b\u3088\u308b\u60c5\u5831\u79d1\u5b66\u5165\u9580\u4f5c\u8005:\u4e45\u91ce \u9756\u8fd1\u4ee3\u79d1\u5b66\u793eAmazon\u65b9\u7a0b\u5f0f f(x) = 0 \u3092 \u3042\u308b\u533a\u9593 [a, b] \u306b\u304a\u3044\u3066\u3001f(x) \u304c\u5358\u8abf\u5897\u52a0\u3001\u9023\u7d9a\u3001f(a) 0 \u3067\u3042\u308b\u3068\u3057\u3066\u3001\u6570\u5024\u8a08\u7b97\u3067\u89e3\u3044\u3066\u307f\u307e\u3059\u3002\u5177\u4f53\u7684\u306b\u306f n \u306e\u5e73\u65b9\u6839\u3092\u6c42\u3081\u3066\u307f\u307e\u3059\u3002 \u533a\u95932\u5206\u6cd5 \u533a\u9593\u306e\u4e2d\u70b9\u3092\u3068\u3063\u3066\u305d\u306e\u70b9\u3067\u306e\u5024\u3092\u8a55\u4fa1\u3057\u3001\u5de6\u53f3\u306e\u9069\u5207\u306a\u533a\u9593\u3092\u9078\u629e\u3057\u3066\u518d\u5e30\u7684\u306b\u8ffd\u3044\u8a70\u3081\u3066\u3044\u304d\u307e\u3059\u3002 def binary_search(n) a = 0; b = n while (a - b).abs > 0.000000000000001 c = (a + b) / 2.0 if c * c > n b = c else a = c en\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2016%2F08%2F16%2F233516\" title=\"1\u5909\u6570\u65b9\u7a0b\u5f0f\u3092\u6570\u5024\u8a08\u7b97\u3067\u89e3\u304f\uff08Ruby\uff09 - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","author_name":"obelisk2","title":"1\u5909\u6570\u65b9\u7a0b\u5f0f\u3092\u6570\u5024\u8a08\u7b97\u3067\u89e3\u304f\uff08Ruby\uff09","width":"100%","blog_url":"https://obelisk.hatenablog.com/","published":"2016-08-16 23:35:16","version":"1.0","image_url":"http://ecx.images-amazon.com/images/I/41rCJqpqShL.jpg","provider_url":"https://hatena.blog","categories":["Ruby","\u6570\u5b66","\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0"],"author_url":"https://blog.hatena.ne.jp/obelisk2/"}