Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include "ruby/internal/config.h"
#include <ctype.h>
#include <float.h>
#include <math.h>
#include "id.h"
#include "internal.h"
#include "internal/bignum.h"
#include "internal/complex.h"
#include "internal/gc.h"
#include "internal/numeric.h"
#include "internal/object.h"
#include "internal/sanitizers.h"
#include "internal/util.h"
#include "internal/variable.h"
#include "internal/warnings.h"
#include "ruby/thread.h"
#include "ruby/util.h"
#include "ruby_assert.h"
Go to the source code of this file.
Data Structures | |
struct | big_div_struct |
struct | big2str_struct |
Macros | |
#define | RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM) |
#define | SIZEOF_BDIGIT_DBL SIZEOF_LONG_LONG |
#define | HOST_BIGENDIAN_P 0 |
#define | LSHIFTABLE(d, n) ((n) < sizeof(d) * CHAR_BIT) |
#define | LSHIFTX(d, n) (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n)))) |
#define | CLEAR_LOWBITS(d, numbits) ((d) & LSHIFTX(~((d)*0), (numbits))) |
#define | FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1)) |
#define | POW2_P(x) (((x)&((x)-1))==0) |
#define | BDIGITS(x) (BIGNUM_DIGITS(x)) |
#define | BITSPERDIG (SIZEOF_BDIGIT*CHAR_BIT) |
#define | BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG) |
#define | BIGRAD_HALF ((BDIGIT)(BIGRAD >> 1)) |
#define | BDIGIT_MSB(d) (((d) & BIGRAD_HALF) != 0) |
#define | BIGUP(x) LSHIFTX(((x) + (BDIGIT_DBL)0), BITSPERDIG) |
#define | BIGDN(x) RSHIFT((x),BITSPERDIG) |
#define | BIGLO(x) ((BDIGIT)((x) & BDIGMAX)) |
#define | BDIGMAX ((BDIGIT)(BIGRAD-1)) |
#define | BDIGIT_DBL_MAX (~(BDIGIT_DBL)0) |
#define | BIGZEROP(x) |
#define | BIGSIZE(x) |
#define | BIGDIVREM_EXTRA_WORDS 1 |
#define | bdigit_roomof(n) roomof(n, SIZEOF_BDIGIT) |
#define | BARY_ARGS(ary) ary, numberof(ary) |
#define | BARY_ADD(z, x, y) bary_add(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) |
#define | BARY_SUB(z, x, y) bary_sub(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) |
#define | BARY_SHORT_MUL(z, x, y) bary_short_mul(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) |
#define | BARY_DIVMOD(q, r, x, y) bary_divmod(BARY_ARGS(q), BARY_ARGS(r), BARY_ARGS(x), BARY_ARGS(y)) |
#define | BARY_ZERO_P(x) bary_zero_p(BARY_ARGS(x)) |
#define | BIGNUM_SET_NEGATIVE_SIGN(b) BIGNUM_SET_SIGN(b, 0) |
#define | BIGNUM_SET_POSITIVE_SIGN(b) BIGNUM_SET_SIGN(b, 1) |
#define | bignew(len, sign) bignew_1(rb_cInteger,(len),(sign)) |
#define | BDIGITS_ZERO(ptr, n) |
#define | BARY_TRUNC(ds, n) |
#define | KARATSUBA_BALANCED(xn, yn) ((yn)/2 < (xn)) |
#define | TOOM3_BALANCED(xn, yn) (((yn)+2)/3 * 2 < (xn)) |
#define | GMP_MUL_DIGITS 20 |
#define | KARATSUBA_MUL_DIGITS 70 |
#define | TOOM3_MUL_DIGITS 150 |
#define | GMP_DIV_DIGITS 20 |
#define | GMP_BIG2STR_DIGITS 20 |
#define | GMP_STR2BIG_DIGITS 20 |
#define | NAIVE_MUL_DIGITS KARATSUBA_MUL_DIGITS |
#define | U16(a) ((uint16_t)(a)) |
#define | U32(a) ((uint32_t)(a)) |
#define | INTEGER_PACK_WORDORDER_MASK |
#define | INTEGER_PACK_BYTEORDER_MASK |
#define | FILL_DD integer_pack_fill_dd(&dp, &de, &dd, &numbits_in_dd) |
#define | TAKE_LOWBITS(n) integer_pack_take_lowbits(n, &dd, &numbits_in_dd) |
#define | reinterpret_cast(type, value) (type)value |
#define | PUSH_BITS(data, numbits) integer_unpack_push_bits(data, numbits, &dd, &numbits_in_dd, &dp) |
#define | BIGNUM_DEBUG (0+RUBY_DEBUG) |
#define | BIGNUM_SET_LEN(b, l) |
#define | conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)]) |
#define | ADV(n) |
#define | ASSERT_LEN() |
#define | MAX_BASE36_POWER_TABLE_ENTRIES (SIZEOF_SIZE_T * CHAR_BIT + 1) |
#define | rb_bdigit_dbl_isqrt(x) (BDIGIT)rb_ulong_isqrt(x) |
#define | BDIGIT_DBL_TO_DOUBLE(n) (double)(n) |
#define | MUL_MODULO(a, b, c) rb_int_modulo(rb_fix_mul_fix((a), (b)), (c)) |
Typedefs | |
typedef void() | mulfunc_t(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
Enumerations | |
enum | big_op_t { big_op_gt , big_op_ge , big_op_lt , big_op_le } |
enum | { DBL_BIGDIG = ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG) } |
Variables | |
const char | ruby_digitmap [] = "0123456789abcdefghijklmnopqrstuvwxyz" |
#define ASSERT_LEN | ( | ) |
#define BARY_TRUNC | ( | ds, | |
n | |||
) |
#define BDIGIT_DBL_MAX (~(BDIGIT_DBL)0) |
#define BDIGIT_MSB | ( | d | ) | (((d) & BIGRAD_HALF) != 0) |
#define bdigit_roomof | ( | n | ) | roomof(n, SIZEOF_BDIGIT) |
#define BDIGITS_ZERO | ( | ptr, | |
n | |||
) |
#define BIGDN | ( | x | ) | RSHIFT((x),BITSPERDIG) |
#define bignew | ( | len, | |
sign | |||
) | bignew_1(rb_cInteger,(len),(sign)) |
#define BIGNUM_DEBUG (0+RUBY_DEBUG) |
#define BIGNUM_SET_LEN | ( | b, | |
l | |||
) |
#define BIGNUM_SET_NEGATIVE_SIGN | ( | b | ) | BIGNUM_SET_SIGN(b, 0) |
#define BIGNUM_SET_POSITIVE_SIGN | ( | b | ) | BIGNUM_SET_SIGN(b, 1) |
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG) |
#define BIGSIZE | ( | x | ) |
#define BIGUP | ( | x | ) | LSHIFTX(((x) + (BDIGIT_DBL)0), BITSPERDIG) |
#define BIGZEROP | ( | x | ) |
#define BITSPERDIG (SIZEOF_BDIGIT*CHAR_BIT) |
#define CLEAR_LOWBITS | ( | d, | |
numbits | |||
) | ((d) & LSHIFTX(~((d)*0), (numbits))) |
#define conv_digit | ( | c | ) | (ruby_digit36_to_number_table[(unsigned char)(c)]) |
#define FILL_DD integer_pack_fill_dd(&dp, &de, &dd, &numbits_in_dd) |
#define FILL_LOWBITS | ( | d, | |
numbits | |||
) | ((d) | (LSHIFTX(((d)*0+1), (numbits))-1)) |
#define INTEGER_PACK_BYTEORDER_MASK |
#define INTEGER_PACK_WORDORDER_MASK |
#define LSHIFTX | ( | d, | |
n | |||
) | (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n)))) |
#define MAX_BASE36_POWER_TABLE_ENTRIES (SIZEOF_SIZE_T * CHAR_BIT + 1) |
#define MUL_MODULO | ( | a, | |
b, | |||
c | |||
) | rb_int_modulo(rb_fix_mul_fix((a), (b)), (c)) |
#define NAIVE_MUL_DIGITS KARATSUBA_MUL_DIGITS |
#define PUSH_BITS | ( | data, | |
numbits | |||
) | integer_unpack_push_bits(data, numbits, &dd, &numbits_in_dd, &dp) |
#define rb_bdigit_dbl_isqrt | ( | x | ) | (BDIGIT)rb_ulong_isqrt(x) |
#define TAKE_LOWBITS | ( | n | ) | integer_pack_take_lowbits(n, &dd, &numbits_in_dd) |
enum big_op_t |
void Init_Bignum | ( | void | ) |
Definition at line 7175 of file bignum.c.
References rb_cInteger, rb_cObject, rb_define_const(), rb_define_method, rb_deprecate_constant, and rb_sprintf().
size_t rb_absint_numwords | ( | VALUE | val, |
size_t | word_numbits, | ||
size_t * | nlz_bits_ret | ||
) |
Definition at line 3388 of file bignum.c.
References assert, CHAR_BIT, rb_absint_size(), and SIZE_MAX.
Referenced by rb_big_pow(), and rb_str_format().
Definition at line 3452 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, dp, FIX2LONG, FIXNUM_P, numberof, POW2_P, and rb_to_int().
Referenced by rb_big_bit_length(), and rb_str_format().
Definition at line 3253 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, CHAR_BIT, dp, FIX2LONG, FIXNUM_P, numberof, rb_to_int(), and SIZEOF_BDIGIT.
Referenced by rb_absint_numwords(), rb_big_bit_length(), and rb_num_to_uint().
double rb_big2dbl | ( | VALUE | x | ) |
Definition at line 5309 of file bignum.c.
References HUGE_VAL, isinf(), and rb_warning().
Referenced by ole_val2variant(), rb_big_minus(), rb_big_mul(), rb_big_plus(), rb_big_pow(), rb_float_div(), rb_float_minus(), rb_float_mul(), rb_float_plus(), and rb_float_pow().
Definition at line 5139 of file bignum.c.
References long(), LONG_MAX, LONG_MIN, num, rb_eRangeError, and rb_raise().
Referenced by rb_num2long().
Definition at line 5090 of file bignum.c.
References big2str_struct::base.
Referenced by rb_int2str(), and rb_str_format().
Definition at line 5004 of file bignum.c.
References big2str_struct::base.
Definition at line 5124 of file bignum.c.
References long(), LONG_MIN, num, rb_eRangeError, and rb_raise().
Referenced by rb_num_to_uint().
Definition at line 6759 of file bignum.c.
References BIGNUM_SET_POSITIVE_SIGN, and rb_big_clone().
Referenced by rb_int_abs().
Definition at line 6357 of file bignum.c.
References BDIGIT, BDIGITS, bignew, FIX2LONG, FIXNUM_P, RB_GC_GUARD, RB_INTEGER_TYPE_P, and rb_num_coerce_bit().
Referenced by rb_int_and().
Definition at line 6678 of file bignum.c.
References BDIGIT, BDIGITS, BIGSIZE, BITSPERDIG, INT2FIX, NUM2LONG, and RB_BIGNUM_TYPE_P.
Definition at line 6787 of file bignum.c.
References BARY_ARGS, BARY_SHORT_MUL, BARY_SUB, BDIGIT, bdigit_roomof, CHAR_BIT, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, LONG2FIX, numberof, rb_absint_singlebit_p(), rb_absint_size(), rb_integer_unpack(), SIZE_MAX, and SIZET2NUM.
Referenced by rb_int_bit_length().
Definition at line 3026 of file bignum.c.
References BDIGIT, BDIGITS, CLASS_OF, len, and MEMCPY.
Referenced by rb_big_abs(), rb_big_comp(), and rb_big_uminus().
Definition at line 5416 of file bignum.c.
References BDIGITS, FIXNUM_P, idCmp, INT2FIX, RB_BIGNUM_TYPE_P, rb_integer_float_cmp(), rb_num_coerce_cmp(), and SIGNED_VALUE.
Referenced by rb_int_cmp(), and rb_integer_float_cmp().
Definition at line 5561 of file bignum.c.
References BDIGIT, BDIGITS, BIGNUM_SET_NEGATIVE_SIGN, BIGNUM_SET_POSITIVE_SIGN, INT2FIX, and rb_big_clone().
Referenced by rb_int_comp().
Definition at line 6088 of file bignum.c.
Referenced by rb_int_div().
Definition at line 6132 of file bignum.c.
References div, FIX2LONG, FIXNUM_P, mod, rb_assoc_new(), RB_BIGNUM_TYPE_P, rb_int2big(), and rb_num_coerce_bin().
Referenced by rb_int_divmod().
Definition at line 2741 of file bignum.c.
References BARY_TRUNC, BDIGIT, BDIGITS, BIGDIVREM_EXTRA_WORDS, bignew, LONG2FIX, rb_assoc_new(), RB_GC_GUARD, rb_num_zerodiv(), big_div_struct::yds, and big_div_struct::yn.
Definition at line 5521 of file bignum.c.
References BDIGIT, BDIGITS, FIXNUM_P, MEMCMP, Qfalse, Qtrue, RB_BIGNUM_TYPE_P, rb_equal(), and rb_integer_float_eq().
Referenced by rb_int_equal(), and rb_integer_float_eq().
Definition at line 6235 of file bignum.c.
References DBL2NUM, and rb_big_fdiv_double().
Definition at line 6206 of file bignum.c.
References DBL2NUM, FIX2LONG, FIXNUM_P, isinf(), isnan, NUM2DBL, RB_BIGNUM_TYPE_P, rb_flo_div_flo(), rb_int2big(), rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by rb_big_fdiv(), and rb_int_fdiv_double().
Definition at line 6094 of file bignum.c.
Referenced by rb_int_idiv().
Definition at line 6908 of file bignum.c.
References BARY_TRUNC, BDIGIT, BDIGITS, BIGDIVREM_EXTRA_WORDS, len, NULL, rb_bdigit_dbl_isqrt, rb_cInteger, rb_gc_force_recycle(), t, ULL2NUM, and ULONG2NUM.
Definition at line 6618 of file bignum.c.
References bit_length, BITSPERDIG, FIX2LONG, FIXNUM_P, int(), long(), RB_BIGNUM_TYPE_P, and rb_to_int().
Referenced by rb_int_lshift().
Definition at line 5850 of file bignum.c.
References DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by rb_int_minus().
Definition at line 6100 of file bignum.c.
References FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_int2big(), and rb_num_coerce_bin().
Referenced by rb_int_modulo().
Definition at line 5930 of file bignum.c.
References DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, rb_int2big(), rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by rb_int_mul().
Definition at line 1880 of file bignum.c.
References BDIGITS, bignew, KARATSUBA_BALANCED, NULL, rb_eArgError, RB_GC_GUARD, and rb_raise().
Definition at line 1571 of file bignum.c.
References BDIGITS, bignew, and RB_GC_GUARD.
Definition at line 2277 of file bignum.c.
References BDIGITS, bignew, NULL, rb_eArgError, RB_GC_GUARD, rb_raise(), and TOOM3_BALANCED.
Definition at line 3158 of file bignum.c.
Referenced by rb_fix_aref().
Definition at line 6476 of file bignum.c.
References BDIGIT, BDIGITS, bignew, FIX2LONG, FIXNUM_P, RB_GC_GUARD, RB_INTEGER_TYPE_P, and rb_num_coerce_bit().
Definition at line 3221 of file bignum.c.
References INTEGER_PACK_2COMP, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and rb_integer_pack().
Definition at line 5821 of file bignum.c.
References DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by rb_int_plus(), and rb_int_succ().
Definition at line 6241 of file bignum.c.
References BIGZEROP, DBL2NUM, FIX2LONG, FIXNUM_MAX, FIXNUM_P, idPow, INT2FIX, LONG2NUM, mask, NULL, NUM2DBL, rb_absint_numwords(), rb_big2dbl(), rb_big_pow(), RB_BIGNUM_TYPE_P, rb_dbl_complex_new_polar_pi(), RB_INTEGER_TYPE_P, rb_num_coerce_bin(), rb_rational_raw(), rb_warn(), RFLOAT_VALUE, and SIGNED_VALUE.
Referenced by rb_big_pow(), and rb_int_pow().
Definition at line 6116 of file bignum.c.
References FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_int2big(), rb_intern(), and rb_num_coerce_bin().
void rb_big_resize | ( | VALUE | big, |
size_t | len | ||
) |
Definition at line 2994 of file bignum.c.
References BIGNUM_SET_LEN, and len.
Definition at line 6648 of file bignum.c.
References bit_length, BITSPERDIG, FIX2LONG, FIXNUM_P, int(), long(), RB_BIGNUM_TYPE_P, and rb_to_int().
size_t rb_big_size | ( | VALUE | big | ) |
Definition at line 6781 of file bignum.c.
References rb_big_size(), and SIZET2NUM.
Definition at line 1640 of file bignum.c.
References BDIGITS, bignew, and RB_GC_GUARD.
Definition at line 5551 of file bignum.c.
References rb_big_clone().
Referenced by rb_int_uminus(), and rb_str_format().
Definition at line 3229 of file bignum.c.
References INTEGER_PACK_2COMP, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and rb_integer_unpack().
Definition at line 6570 of file bignum.c.
References BDIGIT, BDIGITS, bignew, FIX2LONG, FIXNUM_P, RB_GC_GUARD, RB_INTEGER_TYPE_P, and rb_num_coerce_bit().
Definition at line 2930 of file bignum.c.
References BIGZEROP, FIX2LONG, FIXNUM_P, INT2FIX, NIL_P, RB_BIGNUM_TYPE_P, rb_cmperr(), rb_funcall(), and RTEST.
Definition at line 4544 of file bignum.c.
References rb_cstr_to_inum(), and str.
Definition at line 4016 of file bignum.c.
References INT2FIX, NIL_P, NULL, rb_invalid_str(), and str.
Referenced by rb_cstr2inum().
VALUE rb_dbl2big | ( | double | d | ) |
Definition at line 5248 of file bignum.c.
Referenced by rb_integer_float_cmp(), rb_integer_float_eq(), rb_node_case_when_optimizable_literal(), rb_str_format(), and ruby_num_interval_step_size().
Definition at line 3186 of file bignum.c.
References BIGNUM_SET_NEGATIVE_SIGN, neg, and rb_uint2big().
Referenced by rb_big_divmod(), rb_big_fdiv_double(), rb_big_modulo(), rb_big_mul(), rb_big_remainder(), and rb_int2inum().
Definition at line 3214 of file bignum.c.
References FIXABLE, LONG2FIX, and rb_int2big().
VALUE rb_int_parse_cstr | ( | const char * | str, |
ssize_t | len, | ||
char ** | endp, | ||
size_t * | ndigits, | ||
int | base, | ||
int | flags | ||
) |
Definition at line 4045 of file bignum.c.
References ADV, ASSERT_LEN, bit_length, conv_digit, GMP_STR2BIG_DIGITS, INT2FIX, ISSPACE, KARATSUBA_MUL_DIGITS, len, long(), LONG2FIX, NULL, POSFIXABLE, POW2_P, Qnil, RB_INT_PARSE_PREFIX, RB_INT_PARSE_SIGN, RB_INT_PARSE_UNDERSCORE, rb_uint2big(), roomof, ruby_scan_digits(), and str.
Definition at line 7108 of file bignum.c.
References argc, argv, FIX2LONG, FIXNUM_P, HALF_LONG_MSB, INT2FIX, long(), num, Qnil, rb_bigzero_p(), rb_check_arity, rb_eRangeError, rb_eTypeError, rb_int_modulo(), rb_int_negative_p(), rb_int_pow(), rb_int_uminus(), RB_INTEGER_TYPE_P, rb_num_zerodiv(), rb_raise(), and UNREACHABLE_RETURN.
Referenced by Init_Numeric().
Definition at line 5324 of file bignum.c.
References FIX2LONG, FIXNUM_MAX, FIXNUM_MIN, FIXNUM_P, INT2FIX, isinf(), isnan, long(), Qnil, rb_big_cmp(), rb_dbl2big(), and RFLOAT_VALUE.
Referenced by rb_big_cmp(), and rb_float_gt().
COMPILER_WARNING_POP VALUE rb_integer_float_eq | ( | VALUE | x, |
VALUE | y | ||
) |
Definition at line 5383 of file bignum.c.
References FIX2LONG, FIXNUM_P, isinf(), isnan, long(), LONG_MIN, Qfalse, Qtrue, rb_big_eq(), rb_dbl2big(), and RFLOAT_VALUE.
Referenced by rb_big_eq(), and rb_float_equal().
int rb_integer_pack | ( | VALUE | val, |
void * | words, | ||
size_t | numwords, | ||
size_t | wordsize, | ||
size_t | nails, | ||
int | flags | ||
) |
Definition at line 3553 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, FIX2LONG, FIXNUM_P, numberof, RB_GC_GUARD, and rb_to_int().
Referenced by rb_big_pack(), rb_hash(), and rb_str_format().
VALUE rb_integer_unpack | ( | const void * | words, |
size_t | numwords, | ||
size_t | wordsize, | ||
size_t | nails, | ||
int | flags | ||
) |
Definition at line 3639 of file bignum.c.
References BDIGIT, BDIGIT_DBL, BDIGIT_DBL_SIGNED, BDIGIT_MSB, BDIGITS, bignew, BIGUP, INTEGER_PACK_2COMP, INTEGER_PACK_FORCE_BIGNUM, INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION, INTEGER_PACK_LSBYTE_FIRST, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_MSBYTE_FIRST, INTEGER_PACK_MSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, INTEGER_PACK_NEGATIVE, LONG2FIX, LONG_MAX, MEMCPY, NEGFIXABLE, numberof, POSFIXABLE, Qfalse, rb_eArgError, and rb_raise().
Referenced by rb_big_bit_length(), and rb_big_unpack().
Definition at line 4358 of file bignum.c.
References len, RB_GC_GUARD, rb_must_asciicompat(), roomof, RSTRING_LEN, str, and StringValuePtr.
Definition at line 4316 of file bignum.c.
References len, RB_GC_GUARD, rb_must_asciicompat(), roomof, RSTRING_LEN, str, and StringValuePtr.
Definition at line 4280 of file bignum.c.
References bit_length, len, POW2_P, RB_GC_GUARD, rb_must_asciicompat(), RSTRING_LEN, str, and StringValueCStr.
Definition at line 4550 of file bignum.c.
References rb_str_to_inum(), and str.
Definition at line 4252 of file bignum.c.
References INT2FIX, len, NIL_P, NULL, Qnil, rb_must_asciicompat(), RSTRING_GETMEM, str, and StringValue.
Referenced by rb_str_to_inum().
Definition at line 4274 of file bignum.c.
References rb_str_convert_to_inum(), str, and TRUE.
Referenced by rb_str2inum(), rb_str_format(), rb_str_upto_each(), and rb_str_upto_endless_each().
Definition at line 3164 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, bignew, BIGNUM_SET_LEN, and SIZEOF_VALUE.
Referenced by rb_int2big(), rb_int_parse_cstr(), and rb_uint2inum().
Definition at line 3207 of file bignum.c.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
STATIC_ASSERT | ( | bdigit_dbl_signed_signedness | , |
0 | , | ||
(BDIGIT_DBL_SIGNED) - | 1 | ||
) |
STATIC_ASSERT | ( | bdigit_dbl_signedness | ) |
STATIC_ASSERT | ( | bdigit_signedness | ) |
STATIC_ASSERT | ( | rbignum_embed_len_max | , |
BIGNUM_EMBED_LEN_MAX<= | BIGNUM_EMBED_LEN_MASK > > BIGNUM_EMBED_LEN_SHIFT | ||
) |
STATIC_ASSERT | ( | sizeof_bdigit | , |
SIZEOF_BDIGIT<= | sizeofBDIGIT | ||
) |
STATIC_ASSERT | ( | sizeof_bdigit_and_dbl | , |
SIZEOF_BDIGIT *2<= | SIZEOF_BDIGIT_DBL | ||
) |
STATIC_ASSERT | ( | sizeof_bdigit_dbl | , |
sizeof(BDIGIT_DBL) | = =SIZEOF_BDIGIT_DBL |
||
) |
STATIC_ASSERT | ( | sizeof_bdigit_dbl_signed | , |
sizeof(BDIGIT_DBL_SIGNED) | = =SIZEOF_BDIGIT_DBL |
||
) |
STATIC_ASSERT | ( | sizeof_long_and_sizeof_bdigit | , |
SIZEOF_BDIGIT % | SIZEOF_LONG = =0 |
||
) |
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz" |
Definition at line 48 of file bignum.c.
Referenced by rb_fix2str(), and rb_str_format().