#include "internal.h"
#include "id.h"
#include <assert.h>
#include <math.h>
Go to the source code of this file.
◆ BSEARCH
Value: do { \
RETURN_ENUMERATOR(
range, 0, 0); \
org_high = high; \
while (low < high) { \
mid = ((high < 0) == (low < 0)) ? low + ((high - low) / 2) \
: (low < -high) ? -((-1 - low - high)/2 + 1) : (low + high) / 2; \
BSEARCH_CHECK(conv(mid)); \
if (smaller) { \
high = mid; \
} \
else { \
low = mid + 1; \
} \
} \
if (low == org_high) { \
BSEARCH_CHECK(conv(low)); \
if (!smaller)
return Qnil; \
} \
return satisfied; \
} while (0)
#define range(low, item, hi)
◆ BSEARCH_CHECK
#define BSEARCH_CHECK |
( |
|
expr | ) |
|
Value: do { \
VALUE val = (expr); \
} \
satisfied = val; \
smaller = 1; \
} \
smaller = 0; \
} \
if (!cmp) return val; \
smaller = cmp < 0; \
} \
else { \
" (must be numeric, true, false or nil)", \
} \
} while (0)
#define rb_cmpint(cmp, a, b)
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
◆ EXCL
◆ id_cmp
◆ id_max
◆ id_min
◆ id_succ
◆ RANGE_SET_BEG
◆ RANGE_SET_END
◆ RANGE_SET_EXCL
◆ rb_intern
◆ RBOOL
◆ Init_Range()
◆ rb_range_beg_len()
Definition at line 1278 of file range.c.
References err, len, NIL_P, NUM2LONG, Qfalse, Qnil, Qtrue, range, rb_eRangeError, rb_raise(), and rb_range_values().
Referenced by rb_ary_aref1().
◆ rb_range_new()
◆ rb_range_values()