37#define DBL_MIN 2.2250738585072014e-308
40#define DBL_MAX 1.7976931348623157e+308
43#define DBL_MIN_EXP (-1021)
46#define DBL_MAX_EXP 1024
49#define DBL_MIN_10_EXP (-307)
52#define DBL_MAX_10_EXP 308
58#define DBL_MANT_DIG 53
61#define DBL_EPSILON 2.2204460492503131e-16
64#ifndef USE_RB_INFINITY
65#elif !defined(WORDS_BIGENDIAN)
72#elif !defined(WORDS_BIGENDIAN)
86 x =
f + (x -
f >= 0.5);
90 x =
f - (
f - x >= 0.5);
97round_half_up(
double x,
double s)
102 if (s == 1.0)
return f;
104 if ((
double)((
f + 0.5) / s) <= x)
f += 1;
108 if ((
double)((
f - 0.5) / s) >= x)
f -= 1;
115round_half_down(
double x,
double s)
117 double f, xs = x * s;
121 if ((
double)((
f - 0.5) / s) >= x)
f -= 1;
125 if ((
double)((
f + 0.5) / s) <= x)
f += 1;
132round_half_even(
double x,
double s)
134 double f, d, xs = x * s;
141 else if (d == 0.5 || ((
double)((
f + 0.5) / s) <= x))
152 else if (d == 0.5 || ((
double)((
f - 0.5) / s) >= x))
163static VALUE fix_lshift(
long,
unsigned long);
164static VALUE fix_rshift(
long,
unsigned long);
165static VALUE int_pow(
long x,
unsigned long y);
167static int int_round_zero_p(
VALUE num,
int ndigits);
171static int float_round_overflow(
int ndigits,
int binexp);
172static int float_round_underflow(
int ndigits,
int binexp);
176#define id_divmod idDivmod
177#define id_to_i idTo_i
184#ifndef RUBY_INTEGER_UNIFICATION
191static ID id_to, id_by;
202 static ID round_kwds[1];
208 if (!round_kwds[0]) {
211 if (!
rb_get_kwargs(opts, round_kwds, 0, 1, &rounding))
goto noopt;
215 else if (
NIL_P(rounding)) {
247#define NUMERR_NEGATIVE 2
248#define NUMERR_TOOLARGE 3
251#if SIZEOF_INT < SIZEOF_LONG
255 *ret = (
unsigned int)
v;
261#if SIZEOF_INT < SIZEOF_LONG
274#define method_basic_p(klass) rb_method_basic_definition_p(klass, mid)
303 return int_pos_p(num);
309 return int_neg_p(num);
315 return rb_num_negative_int_p(num);
368 num_funcall_op_1_recursion(x, func, y);
377 args[0] = (
VALUE)func;
429 coerce_failed(*x, *y);
448 do_coerce(&x, &y,
TRUE);
455 if (do_coerce(&x, &y,
FALSE))
465 if (!do_coerce(&x, &y,
FALSE) ||
508# define num_clone rb_immutable_obj_clone
524# define num_dup num_uplus
552num_imaginary(
VALUE num)
570 do_coerce(&zero, &num,
TRUE);
572 return num_funcall1(zero,
'-', num);
638 VALUE z = num_funcall1(x,
'%', y);
641 ((rb_num_negative_int_p(x) &&
642 rb_num_positive_int_p(y)) ||
643 (rb_num_positive_int_p(x) &&
644 rb_num_negative_int_p(y)))) {
745 if (rb_num_negative_int_p(num)) {
792num_nonzero_p(
VALUE num)
807num_finite_p(
VALUE num)
820num_infinite_p(
VALUE num)
839 return num_funcall0(num,
id_to_i);
850num_positive_p(
VALUE num)
862 return rb_num_compare_with_zero(num, mid);
873num_negative_p(
VALUE num)
875 return rb_num_negative_int_p(num) ?
Qtrue :
Qfalse;
899 flt->float_value = d;
922 int sign, decpt, digs;
925 static const char minf[] =
"-Infinity";
926 const int pos = (value > 0);
929 else if (
isnan(value))
932 p =
ruby_dtoa(value, 0, 0, &decpt, &sign, &e);
934 if ((digs = (
int)(e - p)) >= (
int)
sizeof(
buf)) digs = (
int)
sizeof(
buf) - 1;
959 else if (decpt > -4) {
1095double_div_double(
double x,
double y)
1100 else if (x == 0.0) {
1104 double z =
signbit(y) ? -1.0 : 1.0;
1114 double ret = double_div_double(num, den);
1145 ret = double_div_double(num, den);
1160 return num_funcall1(x,
'/', y);
1164flodivmod(
double x,
double y,
double *divp,
double *modp)
1170 if (modp) *modp = y;
1171 if (divp) *divp = y;
1197 if (modp) *modp =
mod;
1198 if (divp) *divp =
div;
1210 flodivmod(x, y, 0, &
mod);
1268 volatile VALUE a, b;
1312 if (dx < 0 && dy !=
round(dy))
1355 if (x == y)
return INT2FIX(0);
1363 if (x == y)
return Qtrue;
1364 result = num_funcall1(y,
id_eq, x);
1385 volatile double a, b;
1392#if defined(_MSC_VER) && _MSC_VER < 1300
1397 return num_equal(x, y);
1400#if defined(_MSC_VER) && _MSC_VER < 1300
1406#define flo_eq rb_float_equal
1407static VALUE rb_dbl_hash(
double d);
1425rb_dbl_hash(
double d)
1434 if (a == b)
return INT2FIX(0);
1436 if (a < b)
return INT2FIX(-1);
1475 j = (a > 0.0) ? (j > 0 ? 0 : +1) : (j < 0 ? 0 : -1);
1478 if (a > 0.0)
return INT2FIX(1);
1489 return NUM2INT(flo_cmp(x, y));
1516#if defined(_MSC_VER) && _MSC_VER < 1300
1523#if defined(_MSC_VER) && _MSC_VER < 1300
1553#if defined(_MSC_VER) && _MSC_VER < 1300
1560#if defined(_MSC_VER) && _MSC_VER < 1300
1590#if defined(_MSC_VER) && _MSC_VER < 1300
1597#if defined(_MSC_VER) && _MSC_VER < 1300
1627#if defined(_MSC_VER) && _MSC_VER < 1300
1634#if defined(_MSC_VER) && _MSC_VER < 1300
1659#if defined(_MSC_VER) && _MSC_VER < 1300
1668#define flo_eql rb_float_eql
1712flo_zero_p(
VALUE num)
1730flo_is_nan_p(
VALUE num)
1755 return INT2FIX( value < 0 ? -1 : 1 );
1838flo_next_float(
VALUE vx)
1889flo_prev_float(
VALUE vx)
1902 if (number == 0.0) {
1907 frexp(number, &binexp);
1908 if (float_round_overflow(ndigits, binexp))
return num;
1909 if (number > 0.0 && float_round_underflow(ndigits, binexp))
1911 f =
pow(10, ndigits);
1916 num = dbl2ival(
floor(number));
2027 if (number == 0.0) {
2032 frexp(number, &binexp);
2033 if (float_round_overflow(ndigits, binexp))
return num;
2034 if (number < 0.0 && float_round_underflow(ndigits, binexp))
2036 f =
pow(10, ndigits);
2041 num = dbl2ival(
ceil(number));
2048int_round_zero_p(
VALUE num,
int ndigits)
2054 bytes =
sizeof(
long);
2062 return (-0.415241 * ndigits - 0.125 > bytes);
2069 if ((z * y - x) * 2 == y) {
2078 return (x + y / 2) / y * y;
2084 return (x + y / 2 - 1) / y * y;
2096 return int_pos_p(num);
2102 return int_neg_p(num);
2113 if (int_round_zero_p(num, ndigits)) {
2117 f = int_pow(10, -ndigits);
2146 if (int_round_zero_p(num, ndigits))
2148 f = int_pow(10, -ndigits);
2152 if (
neg) x = -x + y - 1;
2169 if (int_round_zero_p(num, ndigits))
2171 f = int_pow(10, -ndigits);
2194 if (int_round_zero_p(num, ndigits))
2196 f = int_pow(10, -ndigits);
2210 if (int_neg_p(num)) {
2273 double number,
f, x;
2283 if (number == 0.0) {
2287 return rb_int_round(flo_to_i(num), ndigits, mode);
2295 frexp(number, &binexp);
2296 if (float_round_overflow(ndigits, binexp))
return num;
2297 if (float_round_underflow(ndigits, binexp))
return DBL2NUM(0);
2298 f =
pow(10, ndigits);
2306float_round_overflow(
int ndigits,
int binexp)
2327 if (ndigits >= float_dig - (binexp > 0 ? binexp / 4 : binexp / 3 - 1)) {
2334float_round_underflow(
int ndigits,
int binexp)
2336 if (ndigits < - (binexp > 0 ? binexp / 3 + 1 : binexp / 4)) {
2411flo_positive_p(
VALUE num)
2425flo_negative_p(
VALUE num)
2508 n= (end - beg)/unit;
2511 return unit > 0 ? beg <= end : beg >= end;
2542 else if (unit == 0) {
2548 for (
i=0;
i<
n;
i++) {
2549 double d =
i*unit+beg;
2550 if (unit >= 0 ? end < d : d < end) d = end;
2594 case -1: cmp =
'<';
break;
2606num_step_negative_p(
VALUE num)
2623 coerce_failed(num,
INT2FIX(0));
2640 if (values[0] !=
Qundef) {
2644 if (values[1] !=
Qundef) {
2654num_step_check_fix_args(
int argc,
VALUE *to,
VALUE *step,
VALUE by,
int fix_nil,
int allow_zero_step)
2672 desc = num_step_negative_p(*step);
2673 if (fix_nil &&
NIL_P(*to)) {
2683 argc = num_step_extract_args(
argc,
argv, to, step, &by);
2684 return num_step_check_fix_args(
argc, to, step, by, fix_nil, allow_zero_step);
2764 num_step_extract_args(
argc,
argv, &to, &step, &by);
2774 num_step_size, from, to, step,
FALSE);
2802 for (;
i >= end;
i += diff)
2806 for (;
i <= end;
i += diff)
2819 ID cmp = desc ?
'<' :
'>';
2829out_of_range_float(
char (*pbuf)[24],
VALUE val)
2831 char *
const buf = *pbuf;
2835 if ((s =
strchr(
buf,
' ')) != 0) *s =
'\0';
2839#define FLOAT_OUT_OF_RANGE(val, type) do { \
2841 rb_raise(rb_eRangeError, "float %s out of range of "type, \
2842 out_of_range_float(&buf, (val))); \
2845#define LONG_MIN_MINUS_ONE ((double)LONG_MIN-1)
2846#define LONG_MAX_PLUS_ONE (2*(double)(LONG_MAX/2+1))
2847#define ULONG_MAX_PLUS_ONE (2*(double)(ULONG_MAX/2+1))
2848#define LONG_MIN_MINUS_ONE_IS_LESS_THAN(n) \
2849 (LONG_MIN_MINUS_ONE == (double)LONG_MIN ? \
2851 LONG_MIN_MINUS_ONE < (n))
2882rb_num2ulong_internal(
VALUE val,
int *wrap_p)
2893 return (
unsigned long)l;
2899 *wrap_p = d <= -1.0;
2901 return (
unsigned long)d;
2902 return (
unsigned long)(
long)d;
2925 return rb_num2ulong_internal(val,
NULL);
2928#if SIZEOF_INT < SIZEOF_LONG
2933 num, num < 0 ?
"small" :
"big");
2939 if ((
long)(
int)num != num) {
2945check_uint(
unsigned long num,
int sign)
2949 if (num < (
unsigned long)
INT_MIN)
2978rb_num2uint(
VALUE val)
2981 unsigned long num = rb_num2ulong_internal(val, &wrap);
2983 check_uint(num, wrap);
2988rb_fix2uint(
VALUE val)
2993 return rb_num2uint(val);
2997 check_uint(num, rb_num_negative_int_p(val));
3019 num, num < 0 ?
"small" :
"big");
3023check_short(
long num)
3025 if ((
long)(
short)num != num) {
3026 rb_out_of_short(num);
3031check_ushort(
unsigned long num,
int sign)
3067 unsigned long num = rb_num2ulong_internal(val, &wrap);
3069 check_ushort(num, wrap);
3083 check_ushort(num, rb_num_negative_int_p(val));
3102#define LLONG_MIN_MINUS_ONE ((double)LLONG_MIN-1)
3103#define LLONG_MAX_PLUS_ONE (2*(double)(LLONG_MAX/2+1))
3104#define ULLONG_MAX_PLUS_ONE (2*(double)(ULLONG_MAX/2+1))
3106#define ULLONG_MAX ((unsigned LONG_LONG)LLONG_MAX*2+1)
3108#define LLONG_MIN_MINUS_ONE_IS_LESS_THAN(n) \
3109 (LLONG_MIN_MINUS_ONE == (double)LLONG_MIN ? \
3111 LLONG_MIN_MINUS_ONE < (n))
3124 if (d < LLONG_MAX_PLUS_ONE && (LLONG_MIN_MINUS_ONE_IS_LESS_THAN(d))) {
3146rb_num2ull(
VALUE val)
3156 if (d < ULLONG_MAX_PLUS_ONE && LLONG_MIN_MINUS_ONE_IS_LESS_THAN(d)) {
3251int_even_p(
VALUE num)
3254 if ((num & 2) == 0) {
3335 return num_funcall1(num,
'+',
INT2FIX(1));
3338#define int_succ rb_int_succ
3352rb_int_pred(
VALUE num)
3361 return num_funcall1(num,
'-',
INT2FIX(1));
3364#define int_pred rb_int_pred
3478fix_uminus(
VALUE num)
3487 return fix_uminus(num);
3492 return num_funcall0(num,
idUMinus);
3520 if (base < 2 || 36 < base) {
3523#if SIZEOF_LONG < SIZEOF_VOIDP
3524# if SIZEOF_VOIDP == SIZEOF_LONG_LONG
3525 if ((val >= 0 && (x & 0xFFFFFFFF00000000ull)) ||
3526 (val < 0 && (x & 0xFFFFFFFF00000000ull) != 0xFFFFFFFF00000000ull)) {
3527 rb_bug(
"Unnormalized Fixnum value %p", (
void *)x);
3538 u = 1 + (
unsigned long)(-(val + 1));
3546 }
while (u /= base);
3592 return rb_fix_plus_fix(x, y);
3611 return fix_plus(x, y);
3618 return fix_plus(x, y);
3639 return rb_fix_minus_fix(x, y);
3657 return fix_minus(x, y);
3666#define SQRT_LONG_MAX HALF_LONG_MSB
3668#define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((n)>=-SQRT_LONG_MAX))
3683 return rb_fix_mul_fix(x, y);
3707 return fix_mul(x, y);
3743 return fix_fdiv_double(x, y);
3788 return rb_fix_div_fix(x, y);
3802 v = fix_divide(x, y,
'/');
3803 return flo_floor(0, 0,
v);
3817 return fix_divide(x, y,
'/');
3824 return fix_div(x, y);
3844 return fix_divide(x, y,
id_div);
3851 return fix_idiv(x, y);
3856 return num_div(x, y);
3876 return rb_fix_mod_fix(x, y);
3894 return fix_mod(x, y);
3899 return num_modulo(x, y);
3923 return num_remainder(x, y);
3944 rb_fix_divmod_fix(x, y, &
div, &
mod);
3954 volatile VALUE a, b;
3971 return fix_divmod(x, y);
3999int_pow(
long x,
unsigned long y)
4004 if (y == 0)
return INT2FIX(1);
4013 while (y % 2 == 0) {
4040 return int_pow(x, y);
4051 if (a == 1)
return INT2FIX(1);
4064 if (b == 0)
return INT2FIX(1);
4065 if (b == 1)
return x;
4070 return int_pow(a, b);
4073 if (a == 1)
return INT2FIX(1);
4075 if (int_even_p(y))
return INT2FIX(1);
4088 if (a == 0)
return INT2FIX(0);
4094 if (dy == 0.0)
return DBL2NUM(1.0);
4098 if (a == 1)
return DBL2NUM(1.0);
4100 if (a < 0 && dy !=
round(dy))
4114 return fix_pow(x, y);
4126 if (!
NIL_P(z))
return z;
4154 if (x == y)
return Qtrue;
4163 return num_equal(x, y);
4171 return fix_equal(x, y);
4195 if (x == y)
return INT2FIX(0);
4220 return fix_cmp(x, y);
4260 return fix_gt(x, y);
4300 return fix_ge(x, y);
4338 return fix_lt(x, y);
4378 return fix_le(x, y);
4411 return fix_comp(num);
4425 num_funcall_op_1_recursion(x, func, y);
4435 args[0] = (
VALUE)func;
4438 do_coerce(&args[1], &args[2],
TRUE);
4440 args[2], args[1], (
VALUE)args);
4443 coerce_failed(x, y);
4475 return fix_and(x, y);
4510 return fix_or(x, y);
4545 return fix_xor(x, y);
4573 return fix_rshift(val, (
unsigned long)-width);
4574 return fix_lshift(val, width);
4578fix_lshift(
long val,
unsigned long width)
4592 return rb_fix_lshift(x, y);
4619 if (
i == 0)
return x;
4621 return fix_lshift(val, (
unsigned long)-
i);
4622 return fix_rshift(val,
i);
4626fix_rshift(
long val,
unsigned long i)
4629 if (val < 0)
return INT2FIX(-1);
4640 return rb_fix_rshift(x, y);
4667 if (val < 0)
return INT2FIX(1);
4701 VALUE orig_num = num, beg, end;
4707 if (!
RTEST(num_negative_p(end))) {
4721 num = rb_int_rshift(num, beg);
4723 int cmp = compare_indexes(beg, end);
4724 if (!
NIL_P(end) && cmp < 0) {
4730 else if (cmp == 0) {
4752 num = rb_int_rshift(num, beg);
4801 return int_aref2(num,
argv[0],
argv[1]);
4803 return int_aref1(num,
argv[0]);
4865 return fix_abs(num);
4899 return fix_size(num);
4953rb_fix_bit_length(
VALUE fix)
4962rb_int_bit_length(
VALUE num)
4965 return rb_fix_bit_length(num);
4994rb_fix_digits(
VALUE fix,
long base)
5033 return rb_fix_digits(num,
FIX2LONG(base));
5063 return rb_int_digits_bigbase(num, base_value);
5075 return rb_fix_digits(num, base);
5077 return rb_int_digits_bigbase(num,
LONG2FIX(base));
5199int_dotimes(
VALUE num)
5207 for (
i=0;
i<end;
i++) {
5268 return rb_int_round(num, ndigits, mode);
5367#define DEFINE_INT_SQRT(rettype, prefix, argtype) \
5369prefix##_isqrt(argtype n) \
5371 if (!argtype##_IN_DOUBLE_P(n)) { \
5372 unsigned int b = bit_length(n); \
5374 rettype x = (rettype)(n >> (b/2+1)); \
5375 x |= ((rettype)1LU << (b-1)/2); \
5376 while ((t = n/x) < (argtype)x) x = (rettype)((x + t) >> 1); \
5379 return (rettype)sqrt(argtype##_TO_DOUBLE(n)); \
5382#if SIZEOF_LONG*CHAR_BIT > DBL_MANT_DIG
5383# define RB_ULONG_IN_DOUBLE_P(n) ((n) < (1UL << DBL_MANT_DIG))
5385# define RB_ULONG_IN_DOUBLE_P(n) 1
5387#define RB_ULONG_TO_DOUBLE(n) (double)(n)
5388#define RB_ULONG unsigned long
5391#if 2*SIZEOF_BDIGIT > SIZEOF_LONG
5392# if 2*SIZEOF_BDIGIT*CHAR_BIT > DBL_MANT_DIG
5393# define BDIGIT_DBL_IN_DOUBLE_P(n) ((n) < ((BDIGIT_DBL)1UL << DBL_MANT_DIG))
5395# define BDIGIT_DBL_IN_DOUBLE_P(n) 1
5397# ifdef ULL_TO_DOUBLE
5398# define BDIGIT_DBL_TO_DOUBLE(n) ULL_TO_DOUBLE(n)
5400# define BDIGIT_DBL_TO_DOUBLE(n) (double)(n)
5405#define domain_error(msg) \
5406 rb_raise(rb_eMathDomainError, "Numerical argument is out of domain - " #msg)
5439 unsigned long n, sq;
5455 if (biglen == 0)
return INT2FIX(0);
5456#if SIZEOF_BDIGIT <= SIZEOF_LONG
5567#define rb_intern(str) rb_intern_const(str)
5685#ifndef RUBY_INTEGER_UNIFICATION
5839#undef rb_float_value
5843 return rb_float_value_inline(
v);
5850 return rb_float_new_inline(d);
VALUE rb_int2big(intptr_t n)
unsigned long rb_ulong_isqrt(unsigned long)
void rb_cmperr(VALUE x, VALUE y)
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
rb_encoding * rb_ascii8bit_encoding(void)
rb_encoding * rb_default_internal_encoding(void)
rb_encoding * rb_to_encoding(VALUE enc)
int rb_enc_codelen(int c, rb_encoding *enc)
#define rb_enc_mbcput(c, buf, enc)
VALUE rb_enc_str_new(const char *, long, rb_encoding *)
#define rb_cmpint(cmp, a, b)
char str[HTML_ESCAPE_MAX_LEN+1]
void rb_include_module(VALUE, VALUE)
VALUE rb_define_class(const char *, VALUE)
Defines a top-level class.
VALUE rb_singleton_class(VALUE)
Returns the singleton class of obj.
ID rb_frame_this_func(void)
The original name of the current method.
void rb_undef_method(VALUE, const char *)
void rb_define_alias(VALUE, const char *, const char *)
Defines an alias of a method.
int rb_block_given_p(void)
Determines if the current method is given a block.
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *)
VALUE rb_cObject
Object class.
VALUE rb_eFloatDomainError
VALUE rb_eMathDomainError
void rb_raise(VALUE exc, const char *fmt,...)
void rb_bug(const char *fmt,...)
void rb_name_error(ID id, const char *fmt,...)
VALUE rb_Float(VALUE)
Equivalent to Kernel#Float in Ruby.
VALUE rb_any_to_s(VALUE)
Default implementation of #to_s.
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
VALUE rb_equal(VALUE, VALUE)
Same as Object#===, case equality.
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
VALUE rb_immutable_obj_clone(int, VALUE *, VALUE)
VALUE rb_to_int(VALUE)
Converts val into Integer.
int rb_int_negative_p(VALUE num)
void rb_num_zerodiv(void)
VALUE rb_float_uminus(VALUE flt)
const union bytesequence4_or_float rb_infinity
VALUE rb_float_floor(VALUE num, int ndigits)
VALUE rb_int_modulo(VALUE x, VALUE y)
MJIT_FUNC_EXPORTED VALUE rb_fix_aref(VALUE fix, VALUE idx)
#define FLOAT_OUT_OF_RANGE(val, type)
VALUE rb_num_pow(VALUE x, VALUE y)
VALUE rb_int_truncate(VALUE num, int ndigits)
VALUE rb_num2fix(VALUE val)
VALUE rb_int_abs(VALUE num)
VALUE rb_int_div(VALUE x, VALUE y)
#define method_basic_p(klass)
short rb_fix2short(VALUE val)
VALUE rb_float_pow(VALUE x, VALUE y)
VALUE rb_int_pow(VALUE x, VALUE y)
long rb_num2long(VALUE val)
VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc)
VALUE rb_int_uminus(VALUE num)
VALUE rb_float_mul(VALUE x, VALUE y)
VALUE rb_int_equal(VALUE x, VALUE y)
VALUE rb_float_plus(VALUE x, VALUE y)
VALUE rb_int_positive_pow(long x, unsigned long y)
VALUE rb_num_coerce_cmp(VALUE x, VALUE y, ID func)
MJIT_FUNC_EXPORTED VALUE rb_float_equal(VALUE x, VALUE y)
VALUE rb_int_cmp(VALUE x, VALUE y)
#define ULONG_MAX_PLUS_ONE
VALUE rb_int2str(VALUE x, int base)
#define domain_error(msg)
VALUE rb_int_and(VALUE x, VALUE y)
VALUE rb_float_abs(VALUE flt)
MJIT_FUNC_EXPORTED VALUE rb_float_eql(VALUE x, VALUE y)
VALUE rb_num_coerce_bin(VALUE x, VALUE y, ID func)
#define DEFINE_INT_SQRT(rettype, prefix, argtype)
VALUE rb_int_floor(VALUE num, int ndigits)
VALUE rb_int_lshift(VALUE x, VALUE y)
double ruby_float_step_size(double beg, double end, double unit, int excl)
short rb_num2short(VALUE val)
MJIT_FUNC_EXPORTED int rb_float_cmp(VALUE x, VALUE y)
VALUE rb_float_gt(VALUE x, VALUE y)
NORETURN(static void num_funcall_op_1_recursion(VALUE x, ID func, VALUE y))
VALUE rb_int_fdiv(VALUE x, VALUE y)
VALUE rb_float_ceil(VALUE num, int ndigits)
double rb_int_fdiv_double(VALUE x, VALUE y)
int rb_int_positive_p(VALUE num)
VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl)
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless)
enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts)
VALUE rb_flo_is_finite_p(VALUE num)
const union bytesequence4_or_float rb_nan
VALUE rb_num_coerce_bit(VALUE x, VALUE y, ID func)
VALUE rb_int_ge(VALUE x, VALUE y)
VALUE rb_float_div(VALUE x, VALUE y)
VALUE rb_fix2str(VALUE x, int base)
#define LONG_MIN_MINUS_ONE_IS_LESS_THAN(n)
VALUE rb_int_minus(VALUE x, VALUE y)
VALUE rb_flo_is_infinite_p(VALUE num)
VALUE rb_int_odd_p(VALUE num)
long rb_num2int(VALUE val)
int rb_num_to_uint(VALUE val, unsigned int *ret)
VALUE rb_fix_plus(VALUE x, VALUE y)
unsigned short rb_fix2ushort(VALUE val)
unsigned long rb_num2ulong(VALUE val)
VALUE rb_int_divmod(VALUE x, VALUE y)
VALUE rb_float_new_in_heap(double d)
MJIT_FUNC_EXPORTED double ruby_float_mod(double x, double y)
VALUE rb_int_idiv(VALUE x, VALUE y)
VALUE rb_big_isqrt(VALUE)
int rb_num_negative_p(VALUE num)
VALUE rb_dbl_cmp(double a, double b)
VALUE rb_int_ceil(VALUE num, int ndigits)
VALUE rb_float_minus(VALUE x, VALUE y)
double rb_float_value(VALUE v)
unsigned short rb_num2ushort(VALUE val)
VALUE rb_num_coerce_relop(VALUE x, VALUE y, ID func)
#define LONG_MAX_PLUS_ONE
long rb_fix2int(VALUE val)
VALUE rb_float_new(double d)
MJIT_FUNC_EXPORTED VALUE rb_flo_div_flo(VALUE x, VALUE y)
VALUE rb_int_plus(VALUE x, VALUE y)
VALUE rb_int_gt(VALUE x, VALUE y)
VALUE rb_int_succ(VALUE num)
VALUE rb_int_mul(VALUE x, VALUE y)
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE
#define ONIGERR_INVALID_CODE_POINT_VALUE
MJIT_STATIC void rb_error_arity(int argc, int min, int max)