Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns an element from self selected by a binary search.
See Binary Searching.
 
               static VALUE
rb_ary_bsearch(VALUE ary)
{
    VALUE index_result = rb_ary_bsearch_index(ary);

    if (FIXNUM_P(index_result)) {
        return rb_ary_entry(ary, FIX2LONG(index_result));
    }
    return index_result;
}
            

Was this page useful?