{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1871","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1871/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1871/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1871/events","html_url":"https://github.com/manastech/crystal/pull/1871","id":115331570,"number":1871,"title":"Improve #1859, add binary searching methods","user":{"login":"MakeNowJust","id":6679325,"avatar_url":"https://avatars.githubusercontent.com/u/6679325?v=3","gravatar_id":"","url":"https://api.github.com/users/MakeNowJust","html_url":"https://github.com/MakeNowJust","followers_url":"https://api.github.com/users/MakeNowJust/followers","following_url":"https://api.github.com/users/MakeNowJust/following{/other_user}","gists_url":"https://api.github.com/users/MakeNowJust/gists{/gist_id}","starred_url":"https://api.github.com/users/MakeNowJust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakeNowJust/subscriptions","organizations_url":"https://api.github.com/users/MakeNowJust/orgs","repos_url":"https://api.github.com/users/MakeNowJust/repos","events_url":"https://api.github.com/users/MakeNowJust/events{/privacy}","received_events_url":"https://api.github.com/users/MakeNowJust/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-05T17:17:58Z","updated_at":"2015-11-06T09:19:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/manastech/crystal/pulls/1871","html_url":"https://github.com/manastech/crystal/pull/1871","diff_url":"https://github.com/manastech/crystal/pull/1871.diff","patch_url":"https://github.com/manastech/crystal/pull/1871.patch"},"body":"See #1859.\r\n\r\nThis implementation supports to search in Int range and also Float\r\nor some types range.\r\n\r\nIt uses integer and floating point value hack. This hack comes from [Ruby's implementation](https://github.com/ruby/ruby/blob/72ff61f4a8ae7a8bf05b0bd6f91b3b290645627c/range.c#L595-L662)."},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/154352290","html_url":"https://github.com/manastech/crystal/pull/1871#issuecomment-154352290","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1871","id":154352290,"user":{"login":"MakeNowJust","id":6679325,"avatar_url":"https://avatars.githubusercontent.com/u/6679325?v=3","gravatar_id":"","url":"https://api.github.com/users/MakeNowJust","html_url":"https://github.com/MakeNowJust","followers_url":"https://api.github.com/users/MakeNowJust/followers","following_url":"https://api.github.com/users/MakeNowJust/following{/other_user}","gists_url":"https://api.github.com/users/MakeNowJust/gists{/gist_id}","starred_url":"https://api.github.com/users/MakeNowJust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakeNowJust/subscriptions","organizations_url":"https://api.github.com/users/MakeNowJust/orgs","repos_url":"https://api.github.com/users/MakeNowJust/repos","events_url":"https://api.github.com/users/MakeNowJust/events{/privacy}","received_events_url":"https://api.github.com/users/MakeNowJust/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T09:19:26Z","updated_at":"2015-11-06T09:19:26Z","body":"I think that doing binary search in a range of floats has more use cases than doing in a range of  intagers, because it can solve many mathematical problem.\r\n\r\n```crystal\r\n# solve x^4 = 800\r\n(0...Float64::INFINITY).bsearch{|x| x ** 4 >= 800} # => 5.3183\r\n```\r\n\r\nMacros are too many, I think so too. I will try to reduce some macros."}}