Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/thread.h"
#include "ruby/util.h"
#include <math.h>
#include <float.h>
#include <ctype.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 | ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2)) |
#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 | 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 | PUSH_BITS(data, numbits) integer_unpack_push_bits(data, numbits, &dd, &numbits_in_dd, &dp) |
#define | BIGNUM_DEBUG 0 |
#define | ON_DEBUG(x) |
#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 | DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG) |
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 } |
Functions | |
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_bdigit, SIZEOF_BDIGIT<=sizeof(BDIGIT)) | |
STATIC_ASSERT (sizeof_bdigit_and_dbl, SIZEOF_BDIGIT *2<=SIZEOF_BDIGIT_DBL) | |
STATIC_ASSERT (bdigit_signedness, 0<(BDIGIT) -1) | |
STATIC_ASSERT (bdigit_dbl_signedness, 0<(BDIGIT_DBL) -1) | |
STATIC_ASSERT (bdigit_dbl_signed_signedness, 0 >(BDIGIT_DBL_SIGNED) -1) | |
STATIC_ASSERT (rbignum_embed_len_max, BIGNUM_EMBED_LEN_MAX<=(BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT)) | |
STATIC_ASSERT (sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG==0) | |
static BDIGIT | bigdivrem_single (BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT y) |
static void | bary_divmod (BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static VALUE | bigmul0 (VALUE x, VALUE y) |
static void | bary_mul_toom3 (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
static VALUE | bignew_1 (VALUE klass, size_t len, int sign) |
static VALUE | bigtrunc (VALUE x) |
static VALUE | bigsq (VALUE x) |
static void | bigdivmod (VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp) |
static VALUE | power_cache_get_power (int base, int power_level, size_t *numdigits_ret) |
static int | nlz (BDIGIT x) |
static BDIGIT_DBL | maxpow_in_bdigit_dbl (int base, int *exp_ret) |
static BDIGIT_DBL | bary2bdigitdbl (const BDIGIT *ds, size_t n) |
static void | bdigitdbl2bary (BDIGIT *ds, size_t n, BDIGIT_DBL num) |
static int | bary_cmp (const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static BDIGIT | bary_small_lshift (BDIGIT *zds, const BDIGIT *xds, size_t n, int shift) |
static void | bary_small_rshift (BDIGIT *zds, const BDIGIT *xds, size_t n, int shift, BDIGIT higher_bdigit) |
static int | bary_zero_p (BDIGIT *xds, size_t xn) |
static void | bary_neg (BDIGIT *ds, size_t n) |
static int | bary_2comp (BDIGIT *ds, size_t n) |
static void | bary_swap (BDIGIT *ds, size_t num_bdigits) |
static void | validate_integer_pack_format (size_t numwords, size_t wordsize, size_t nails, int flags, int supported_flags) |
static void | integer_pack_loop_setup (size_t numwords, size_t wordsize, size_t nails, int flags, size_t *word_num_fullbytes_ret, int *word_num_partialbits_ret, size_t *word_start_ret, ssize_t *word_step_ret, size_t *word_last_ret, size_t *byte_start_ret, int *byte_step_ret) |
static void | integer_pack_fill_dd (BDIGIT **dpp, BDIGIT **dep, BDIGIT_DBL *ddp, int *numbits_in_dd_p) |
static BDIGIT_DBL | integer_pack_take_lowbits (int n, BDIGIT_DBL *ddp, int *numbits_in_dd_p) |
static int | bytes_2comp (unsigned char *buf, size_t len) |
static int | bary_pack (int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords, size_t wordsize, size_t nails, int flags) |
static size_t | integer_unpack_num_bdigits_small (size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret) |
static size_t | integer_unpack_num_bdigits_generic (size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret) |
static size_t | integer_unpack_num_bdigits (size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret) |
static void | integer_unpack_push_bits (int data, int numbits, BDIGIT_DBL *ddp, int *numbits_in_dd_p, BDIGIT **dpp) |
static int | integer_unpack_single_bdigit (BDIGIT u, size_t size, int flags, BDIGIT *dp) |
static int | bary_unpack_internal (BDIGIT *bdigits, size_t num_bdigits, const void *words, size_t numwords, size_t wordsize, size_t nails, int flags, int nlp_bits) |
static void | bary_unpack (BDIGIT *bdigits, size_t num_bdigits, const void *words, size_t numwords, size_t wordsize, size_t nails, int flags) |
static int | bary_subb (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, int borrow) |
static int | bary_sub (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static int | bary_sub_one (BDIGIT *zds, size_t zn) |
static int | bary_addc (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, int carry) |
static int | bary_add (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static int | bary_add_one (BDIGIT *ds, size_t n) |
static void | bary_mul_single (BDIGIT *zds, size_t zn, BDIGIT x, BDIGIT y) |
static int | bary_muladd_1xN (BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn) |
static BDIGIT_DBL_SIGNED | bigdivrem_mulsub (BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn) |
static int | bary_mulsub_1xN (BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn) |
static void | bary_mul_normal (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
VALUE | rb_big_mul_normal (VALUE x, VALUE y) |
static void | bary_sq_fast (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn) |
VALUE | rb_big_sq_fast (VALUE x) |
static void | bary_mul_balance_with_mulfunc (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn, mulfunc_t *mulfunc) |
VALUE | rb_big_mul_balance (VALUE x, VALUE y) |
static void | bary_mul_karatsuba (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
VALUE | rb_big_mul_karatsuba (VALUE x, VALUE y) |
VALUE | rb_big_mul_toom3 (VALUE x, VALUE y) |
static void | bary_short_mul (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static int | bary_sparse_p (const BDIGIT *ds, size_t n) |
static int | bary_mul_precheck (BDIGIT **zdsp, size_t *znp, const BDIGIT **xdsp, size_t *xnp, const BDIGIT **ydsp, size_t *ynp) |
static void | bary_mul_karatsuba_branch (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
static void | bary_mul_karatsuba_start (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
static void | bary_mul_toom3_branch (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
static void | bary_mul_toom3_start (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn) |
static void | bary_mul (BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static void * | bigdivrem1 (void *ptr) |
static void | rb_big_stop (void *ptr) |
static BDIGIT | bigdivrem_single1 (BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT x_higher_bdigit, BDIGIT y) |
static void | bigdivrem_restoring (BDIGIT *zds, size_t zn, BDIGIT *yds, size_t yn) |
static void | bary_divmod_normal (BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
VALUE | rb_big_divrem_normal (VALUE x, VALUE y) |
static void | bary_divmod_branch (BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn) |
static int | bigzero_p (VALUE x) |
int | rb_bigzero_p (VALUE x) |
int | rb_cmpint (VALUE val, VALUE a, VALUE b) |
static void | rb_big_realloc (VALUE big, size_t len) |
void | rb_big_resize (VALUE big, size_t len) |
VALUE | rb_big_new (size_t len, int sign) |
VALUE | rb_big_clone (VALUE x) |
static void | big_extend_carry (VALUE x) |
static void | get2comp (VALUE x) |
void | rb_big_2comp (VALUE x) |
static BDIGIT | abs2twocomp (VALUE *xp, long *n_ret) |
static void | twocomp2abs_bang (VALUE x, int hibits) |
static VALUE | bigfixize (VALUE x) |
static VALUE | bignorm (VALUE x) |
VALUE | rb_big_norm (VALUE x) |
VALUE | rb_uint2big (VALUE n) |
VALUE | rb_int2big (SIGNED_VALUE n) |
VALUE | rb_uint2inum (VALUE n) |
VALUE | rb_int2inum (SIGNED_VALUE n) |
void | rb_big_pack (VALUE val, unsigned long *buf, long num_longs) |
VALUE | rb_big_unpack (unsigned long *buf, long num_longs) |
size_t | rb_absint_size (VALUE val, int *nlz_bits_ret) |
static size_t | absint_numwords_small (size_t numbytes, int nlz_bits_in_msbyte, size_t word_numbits, size_t *nlz_bits_ret) |
static size_t | absint_numwords_generic (size_t numbytes, int nlz_bits_in_msbyte, size_t word_numbits, size_t *nlz_bits_ret) |
size_t | rb_absint_numwords (VALUE val, size_t word_numbits, size_t *nlz_bits_ret) |
int | rb_absint_singlebit_p (VALUE val) |
int | rb_integer_pack (VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags) |
VALUE | rb_integer_unpack (const void *words, size_t numwords, size_t wordsize, size_t nails, int flags) |
NORETURN (static inline void invalid_radix(int base)) | |
NORETURN (static inline void invalid_integer(VALUE s)) | |
static int | valid_radix_p (int base) |
static void | invalid_radix (int base) |
static void | invalid_integer (VALUE s) |
static int | str2big_scan_digits (const char *s, const char *str, int base, int badcheck, size_t *num_digits_p, ssize_t *len_p) |
static VALUE | str2big_poweroftwo (int sign, const char *digits_start, const char *digits_end, size_t num_digits, int bits_per_digit) |
static VALUE | str2big_normal (int sign, const char *digits_start, const char *digits_end, size_t num_bdigits, int base) |
static VALUE | str2big_karatsuba (int sign, const char *digits_start, const char *digits_end, size_t num_digits, size_t num_bdigits, int digits_per_bdigits_dbl, int base) |
VALUE | rb_cstr_to_inum (const char *str, int base, int badcheck) |
VALUE | rb_cstr_parse_inum (const char *str, ssize_t len, char **endp, int base) |
VALUE | rb_str_to_inum (VALUE str, int base, int badcheck) |
VALUE | rb_str2big_poweroftwo (VALUE arg, int base, int badcheck) |
VALUE | rb_str2big_normal (VALUE arg, int base, int badcheck) |
VALUE | rb_str2big_karatsuba (VALUE arg, int base, int badcheck) |
VALUE | rb_cstr2inum (const char *str, int base) |
VALUE | rb_str2inum (VALUE str, int base) |
static VALUE | big_shift3 (VALUE x, int lshift_p, size_t shift_numdigits, int shift_numbits) |
static VALUE | big_shift2 (VALUE x, int lshift_p, VALUE y) |
static VALUE | big_lshift (VALUE x, unsigned long shift) |
static VALUE | big_rshift (VALUE x, unsigned long shift) |
static void | power_cache_init (void) |
static void | big2str_alloc (struct big2str_struct *b2s, size_t len) |
static void | big2str_2bdigits (struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t taillen) |
static void | big2str_karatsuba (struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t wn, int power_level, size_t taillen) |
static VALUE | big2str_base_poweroftwo (VALUE x, int base) |
VALUE | rb_big2str_poweroftwo (VALUE x, int base) |
static VALUE | big2str_generic (VALUE x, int base) |
VALUE | rb_big2str_generic (VALUE x, int base) |
static VALUE | rb_big2str1 (VALUE x, int base) |
VALUE | rb_big2str (VALUE x, int base) |
static unsigned long | big2ulong (VALUE x, const char *type) |
unsigned long | rb_big2ulong (VALUE x) |
long | rb_big2long (VALUE x) |
static VALUE | dbl2big (double d) |
VALUE | rb_dbl2big (double d) |
static double | big2dbl (VALUE x) |
double | rb_big2dbl (VALUE x) |
VALUE | rb_integer_float_cmp (VALUE x, VALUE y) |
VALUE | rb_integer_float_eq (VALUE x, VALUE y) |
VALUE | rb_big_cmp (VALUE x, VALUE y) |
static VALUE | big_op (VALUE x, VALUE y, enum big_op_t op) |
VALUE | rb_big_gt (VALUE x, VALUE y) |
VALUE | rb_big_ge (VALUE x, VALUE y) |
VALUE | rb_big_lt (VALUE x, VALUE y) |
VALUE | rb_big_le (VALUE x, VALUE y) |
VALUE | rb_big_eq (VALUE x, VALUE y) |
VALUE | rb_big_eql (VALUE x, VALUE y) |
VALUE | rb_big_uminus (VALUE x) |
VALUE | rb_big_comp (VALUE x) |
static VALUE | bigsub (VALUE x, VALUE y) |
static VALUE | bigadd_int (VALUE x, long y) |
static VALUE | bigsub_int (VALUE x, long y0) |
static VALUE | bigadd (VALUE x, VALUE y, int sign) |
VALUE | rb_big_plus (VALUE x, VALUE y) |
VALUE | rb_big_minus (VALUE x, VALUE y) |
VALUE | rb_big_mul (VALUE x, VALUE y) |
static VALUE | bigdivrem (VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp) |
static VALUE | rb_big_divide (VALUE x, VALUE y, ID op) |
VALUE | rb_big_div (VALUE x, VALUE y) |
VALUE | rb_big_idiv (VALUE x, VALUE y) |
VALUE | rb_big_modulo (VALUE x, VALUE y) |
VALUE | rb_big_remainder (VALUE x, VALUE y) |
VALUE | rb_big_divmod (VALUE x, VALUE y) |
static VALUE | big_shift (VALUE x, long n) |
static double | big_fdiv (VALUE x, VALUE y, long ey) |
static double | big_fdiv_int (VALUE x, VALUE y) |
static double | big_fdiv_float (VALUE x, VALUE y) |
double | rb_big_fdiv_double (VALUE x, VALUE y) |
VALUE | rb_big_fdiv (VALUE x, VALUE y) |
VALUE | rb_big_pow (VALUE x, VALUE y) |
static VALUE | bigand_int (VALUE x, long xn, BDIGIT hibitsx, long y) |
VALUE | rb_big_and (VALUE x, VALUE y) |
static VALUE | bigor_int (VALUE x, long xn, BDIGIT hibitsx, long y) |
VALUE | rb_big_or (VALUE x, VALUE y) |
static VALUE | bigxor_int (VALUE x, long xn, BDIGIT hibitsx, long y) |
VALUE | rb_big_xor (VALUE x, VALUE y) |
VALUE | rb_big_lshift (VALUE x, VALUE y) |
VALUE | rb_big_rshift (VALUE x, VALUE y) |
VALUE | rb_big_aref (VALUE x, VALUE y) |
VALUE | rb_big_hash (VALUE x) |
static VALUE | rb_int_coerce (VALUE x, VALUE y) |
VALUE | rb_big_abs (VALUE x) |
int | rb_big_sign (VALUE x) |
size_t | rb_big_size (VALUE big) |
VALUE | rb_big_size_m (VALUE big) |
VALUE | rb_big_bit_length (VALUE big) |
VALUE | rb_big_odd_p (VALUE num) |
VALUE | rb_big_even_p (VALUE num) |
void | Init_Bignum (void) |
Variables | |
const char | ruby_digitmap [] = "0123456789abcdefghijklmnopqrstuvwxyz" |
static mulfunc_t | bary_mul_toom3_start |
static mulfunc_t | bary_mul_karatsuba_start |
static VALUE | base36_power_cache [35][MAX_BASE36_POWER_TABLE_ENTRIES] |
static size_t | base36_numdigits_cache [35][MAX_BASE36_POWER_TABLE_ENTRIES] |
#define ADV | ( | n | ) |
Referenced by rb_cstr_parse_inum().
#define ALIGNOF | ( | type | ) | ((int)offsetof(struct { char f1; type f2; }, f2)) |
Definition at line 67 of file bignum.c.
Referenced by bary_pack(), and bary_unpack_internal().
#define ASSERT_LEN | ( | ) |
Referenced by rb_cstr_parse_inum().
Definition at line 106 of file bignum.c.
Referenced by absint_numwords_generic().
#define BARY_ARGS | ( | ary | ) | ary, numberof(ary) |
Definition at line 104 of file bignum.c.
Referenced by absint_numwords_generic(), and rb_big_bit_length().
#define BARY_DIVMOD | ( | q, | |
r, | |||
x, | |||
y | |||
) | bary_divmod(BARY_ARGS(q), BARY_ARGS(r), BARY_ARGS(x), BARY_ARGS(y)) |
Definition at line 109 of file bignum.c.
Referenced by absint_numwords_generic().
#define BARY_SHORT_MUL | ( | z, | |
x, | |||
y | |||
) | bary_short_mul(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) |
Definition at line 108 of file bignum.c.
Referenced by absint_numwords_generic(), and rb_big_bit_length().
Definition at line 107 of file bignum.c.
Referenced by absint_numwords_generic(), and rb_big_bit_length().
#define BARY_TRUNC | ( | ds, | |
n | |||
) |
Definition at line 126 of file bignum.c.
Referenced by abs2twocomp(), bary_cmp(), bary_divmod(), bary_mul_toom3(), big2str_generic(), big2str_karatsuba(), bigdivrem(), bigfixize(), rb_big2str1(), rb_big_divrem_normal(), and str2big_karatsuba().
#define BARY_ZERO_P | ( | x | ) | bary_zero_p(BARY_ARGS(x)) |
Definition at line 110 of file bignum.c.
Referenced by absint_numwords_generic().
#define BDIGIT_DBL_MAX (~(BDIGIT_DBL)0) |
Definition at line 84 of file bignum.c.
Referenced by maxpow_in_bdigit_dbl().
#define BDIGIT_MSB | ( | d | ) | (((d) & BIGRAD_HALF) != 0) |
Definition at line 79 of file bignum.c.
Referenced by bary_unpack_internal(), bigdivrem_restoring(), and rb_integer_unpack().
#define bdigit_roomof | ( | n | ) | roomof(n, SIZEOF_BDIGIT) |
Definition at line 103 of file bignum.c.
Referenced by absint_numwords_generic(), bigadd_int(), bigand_int(), bigdivrem(), bigor_int(), bigsub_int(), bigxor_int(), rb_absint_singlebit_p(), rb_absint_size(), rb_big_bit_length(), rb_integer_pack(), rb_str2big_karatsuba(), and rb_uint2big().
#define BDIGITS | ( | x | ) | (BIGNUM_DIGITS(x)) |
Definition at line 75 of file bignum.c.
Referenced by abs2twocomp(), big2dbl(), big2str_generic(), big2str_karatsuba(), big2ulong(), big_extend_carry(), big_fdiv(), big_fdiv_int(), big_shift3(), bigadd(), bigadd_int(), bigand_int(), bigdivrem(), bigfixize(), bigmul0(), bigor_int(), bigsq(), bigsub(), bigsub_int(), bigtrunc(), bigxor_int(), bigzero_p(), dbl2big(), get2comp(), power_cache_get_power(), rb_absint_singlebit_p(), rb_absint_size(), rb_big2long(), rb_big2str1(), rb_big2str_generic(), rb_big_and(), rb_big_aref(), rb_big_clone(), rb_big_cmp(), rb_big_comp(), rb_big_divrem_normal(), rb_big_eq(), rb_big_eql(), rb_big_even_p(), rb_big_hash(), rb_big_mul_balance(), rb_big_mul_karatsuba(), rb_big_mul_normal(), rb_big_mul_toom3(), rb_big_odd_p(), rb_big_or(), rb_big_sq_fast(), rb_big_xor(), rb_integer_pack(), rb_integer_unpack(), rb_str2big_karatsuba(), rb_uint2big(), str2big_karatsuba(), str2big_normal(), and str2big_poweroftwo().
#define BDIGITS_ZERO | ( | ptr, | |
n | |||
) |
Definition at line 117 of file bignum.c.
Referenced by bary_divmod(), bary_divmod_normal(), bary_mul_balance_with_mulfunc(), bary_mul_normal(), bary_mul_precheck(), bary_mul_single(), bary_mul_toom3(), bary_pack(), bary_sq_fast(), bary_unpack(), big_shift3(), rb_big_divrem_normal(), rb_big_mul_toom3(), str2big_karatsuba(), and str2big_normal().
Definition at line 83 of file bignum.c.
Referenced by abs2twocomp(), bary_subb(), bary_unpack_internal(), big2dbl(), big_shift3(), bigand_int(), bigdivrem1(), bigor_int(), bigxor_int(), and integer_unpack_single_bdigit().
#define BIGDIVREM_EXTRA_WORDS 1 |
Definition at line 102 of file bignum.c.
Referenced by absint_numwords_generic(), bary_divmod_normal(), big2str_generic(), big2str_karatsuba(), bigdivrem(), and rb_big_divrem_normal().
#define BIGDN | ( | x | ) | RSHIFT((x),BITSPERDIG) |
Definition at line 81 of file bignum.c.
Referenced by bary_addc(), bary_divmod(), bary_muladd_1xN(), bary_mulsub_1xN(), bary_small_lshift(), bary_sq_fast(), bary_subb(), bdigitdbl2bary(), bigadd_int(), bigand_int(), bigdivrem(), bigdivrem_mulsub(), bigor_int(), bigsub_int(), bigxor_int(), integer_unpack_push_bits(), rb_absint_singlebit_p(), rb_absint_size(), rb_integer_pack(), rb_str2big_karatsuba(), rb_uint2big(), str2big_karatsuba(), str2big_normal(), and str2big_poweroftwo().
Definition at line 82 of file bignum.c.
Referenced by bary_2comp(), bary_add_one(), bary_addc(), bary_divmod(), bary_muladd_1xN(), bary_mulsub_1xN(), bary_neg(), bary_small_lshift(), bary_small_rshift(), bary_sq_fast(), bary_subb(), bary_unpack_internal(), bdigitdbl2bary(), big2dbl(), bigadd_int(), bigand_int(), bigdivrem(), bigdivrem_mulsub(), bigor_int(), bigsub_int(), bigxor_int(), integer_unpack_push_bits(), integer_unpack_single_bdigit(), rb_absint_singlebit_p(), rb_absint_size(), rb_integer_pack(), rb_str2big_karatsuba(), rb_uint2big(), str2big_karatsuba(), str2big_normal(), and str2big_poweroftwo().
#define bignew | ( | len, | |
sign | |||
) | bignew_1(rb_cInteger,(len),(sign)) |
Definition at line 115 of file bignum.c.
Referenced by big_shift3(), bigadd(), bigadd_int(), bigand_int(), bigdivrem(), bigmul0(), bigor_int(), bigsq(), bigsub(), bigsub_int(), bigxor_int(), dbl2big(), power_cache_get_power(), rb_big_and(), rb_big_divrem_normal(), rb_big_mul_balance(), rb_big_mul_karatsuba(), rb_big_mul_normal(), rb_big_mul_toom3(), rb_big_new(), rb_big_or(), rb_big_sq_fast(), rb_big_xor(), rb_integer_unpack(), rb_str2big_karatsuba(), rb_uint2big(), str2big_karatsuba(), str2big_normal(), and str2big_poweroftwo().
#define BIGNUM_SET_LEN | ( | b, | |
l | |||
) |
Definition at line 2930 of file bignum.c.
Referenced by bignew_1(), rb_big_realloc(), rb_big_resize(), rb_str2big_karatsuba(), and rb_uint2big().
#define BIGNUM_SET_NEGATIVE_SIGN | ( | b | ) | BIGNUM_SET_SIGN(b, 0) |
Definition at line 112 of file bignum.c.
Referenced by bigsub(), rb_big_comp(), rb_int2big(), and rb_str2big_karatsuba().
#define BIGNUM_SET_POSITIVE_SIGN | ( | b | ) | BIGNUM_SET_SIGN(b, 1) |
Definition at line 113 of file bignum.c.
Referenced by rb_big_abs(), and rb_big_comp().
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG) |
#define BIGSIZE | ( | x | ) |
Definition at line 97 of file bignum.c.
Referenced by big2ulong(), rb_big2long(), rb_big_aref(), and rb_big_size().
#define BIGUP | ( | x | ) | LSHIFTX(((x) + (BDIGIT_DBL)0), BITSPERDIG) |
Definition at line 80 of file bignum.c.
Referenced by bary2bdigitdbl(), bary_small_rshift(), bigdivrem1(), bigdivrem_single1(), bigfixize(), rb_big2long(), and rb_integer_unpack().
#define BIGZEROP | ( | x | ) |
Definition at line 94 of file bignum.c.
Referenced by big_shift2(), bigdivmod(), rb_big_pow(), rb_bigzero_p(), and rb_cmpint().
#define BITSPERDIG (SIZEOF_BDIGIT*CHAR_BIT) |
Definition at line 76 of file bignum.c.
Referenced by bary_small_lshift(), bary_small_rshift(), bary_unpack_internal(), big2dbl(), big2str_generic(), big2ulong(), big_fdiv(), big_fdiv_int(), big_lshift(), big_rshift(), big_shift2(), integer_pack_fill_dd(), integer_unpack_num_bdigits(), integer_unpack_num_bdigits_generic(), integer_unpack_num_bdigits_small(), integer_unpack_push_bits(), rb_big2str1(), rb_big_aref(), rb_big_lshift(), rb_big_rshift(), rb_str2big_karatsuba(), and str2big_poweroftwo().
#define CLEAR_LOWBITS | ( | d, | |
numbits | |||
) | ((d) & LSHIFTX(~((d)*0), (numbits))) |
Definition at line 71 of file bignum.c.
Referenced by bary_pack().
#define conv_digit | ( | c | ) | (ruby_digit36_to_number_table[(unsigned char)(c)]) |
Definition at line 3688 of file bignum.c.
Referenced by rb_cstr_parse_inum(), str2big_karatsuba(), str2big_normal(), str2big_poweroftwo(), and str2big_scan_digits().
#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG) |
Referenced by big_fdiv(), and big_fdiv_int().
#define FILL_DD integer_pack_fill_dd(&dp, &de, &dd, &numbits_in_dd) |
Referenced by bary_pack().
#define FILL_LOWBITS | ( | d, | |
numbits | |||
) | ((d) | (LSHIFTX(((d)*0+1), (numbits))-1)) |
Definition at line 72 of file bignum.c.
Referenced by bary_pack().
#define GMP_BIG2STR_DIGITS 20 |
Definition at line 139 of file bignum.c.
Referenced by rb_big2str1().
#define GMP_DIV_DIGITS 20 |
Definition at line 138 of file bignum.c.
Referenced by bary_divmod_branch().
#define GMP_MUL_DIGITS 20 |
Definition at line 134 of file bignum.c.
Referenced by bary_mul(), and bigsq().
#define GMP_STR2BIG_DIGITS 20 |
Definition at line 140 of file bignum.c.
Referenced by rb_cstr_parse_inum().
#define HOST_BIGENDIAN_P 0 |
Definition at line 65 of file bignum.c.
Referenced by bary_pack(), and bary_unpack_internal().
#define INTEGER_PACK_BYTEORDER_MASK |
Definition at line 484 of file bignum.c.
Referenced by bary_pack(), bary_unpack_internal(), integer_pack_loop_setup(), and validate_integer_pack_format().
#define INTEGER_PACK_WORDORDER_MASK |
Definition at line 481 of file bignum.c.
Referenced by bary_pack(), bary_unpack_internal(), integer_pack_loop_setup(), and validate_integer_pack_format().
#define KARATSUBA_BALANCED | ( | xn, | |
yn | |||
) | ((yn)/2 < (xn)) |
Definition at line 131 of file bignum.c.
Referenced by bary_mul_balance_with_mulfunc(), bary_mul_karatsuba_branch(), and rb_big_mul_karatsuba().
#define KARATSUBA_MUL_DIGITS 70 |
Definition at line 135 of file bignum.c.
Referenced by bary_mul(), bary_mul_karatsuba_branch(), bigsq(), and rb_cstr_parse_inum().
#define LSHIFTX | ( | d, | |
n | |||
) | (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n)))) |
Definition at line 70 of file bignum.c.
Referenced by integer_unpack_single_bdigit().
#define MAX_BASE36_POWER_TABLE_ENTRIES (SIZEOF_SIZE_T * CHAR_BIT + 1) |
Definition at line 4597 of file bignum.c.
Referenced by big2str_generic(), power_cache_get_power(), and power_cache_init().
#define POW2_P | ( | x | ) | (((x)&((x)-1))==0) |
Definition at line 73 of file bignum.c.
Referenced by bary_mul_precheck(), bary_pack(), big_shift2(), bigdivrem_single1(), rb_absint_singlebit_p(), rb_big2str1(), rb_cstr_parse_inum(), and rb_str2big_poweroftwo().
#define PUSH_BITS | ( | data, | |
numbits | |||
) | integer_unpack_push_bits(data, numbits, &dd, &numbits_in_dd, &dp) |
Referenced by bary_unpack_internal().
Definition at line 32 of file bignum.c.
Referenced by bignorm(), rb_big_aref(), rb_big_cmp(), rb_big_divide(), rb_big_divmod(), rb_big_eq(), rb_big_eql(), rb_big_fdiv_double(), rb_big_lshift(), rb_big_minus(), rb_big_modulo(), rb_big_mul(), rb_big_plus(), rb_big_pow(), rb_big_remainder(), rb_big_rshift(), and rb_cmpint().
#define SIZEOF_BDIGIT_DBL SIZEOF_LONG_LONG |
Definition at line 41 of file bignum.c.
Referenced by big2str_2bdigits().
#define TAKE_LOWBITS | ( | n | ) | integer_pack_take_lowbits(n, &dd, &numbits_in_dd) |
Referenced by bary_pack().
#define TOOM3_BALANCED | ( | xn, | |
yn | |||
) | (((yn)+2)/3 * 2 < (xn)) |
Definition at line 132 of file bignum.c.
Referenced by bary_mul_balance_with_mulfunc(), bary_mul_toom3_branch(), and rb_big_mul_toom3().
#define TOOM3_MUL_DIGITS 150 |
Definition at line 136 of file bignum.c.
Referenced by bary_mul_toom3_branch().
enum big_op_t |
Definition at line 3039 of file bignum.c.
References bary_2comp(), BARY_TRUNC, BDIGIT, BDIGITS, BDIGMAX, bignew_1(), BIGNUM_LEN, BIGNUM_NEGATIVE_P, CLASS_OF, and MEMCPY.
Referenced by big_shift3(), rb_big_and(), rb_big_or(), and rb_big_xor().
|
static |
Definition at line 3292 of file bignum.c.
References BARY_ADD, BARY_ARGS, BARY_DIVMOD, bary_pack(), BARY_SHORT_MUL, BARY_SUB, bary_unpack(), BARY_ZERO_P, BDIGIT, bdigit_roomof, BIGDIVREM_EXTRA_WORDS, CHAR_BIT, INTEGER_PACK_NATIVE_BYTE_ORDER, mod, numberof, and one().
Referenced by rb_absint_numwords().
|
static |
|
inlinestatic |
Definition at line 360 of file bignum.c.
Referenced by bary_divmod(), big2str_2bdigits(), and bigdivrem().
|
static |
Definition at line 449 of file bignum.c.
References BIGLO.
Referenced by abs2twocomp(), bary_mul_karatsuba(), bary_mul_toom3(), bary_pack(), bary_unpack_internal(), bigsub(), and get2comp().
|
static |
Definition at line 1422 of file bignum.c.
References bary_addc().
Referenced by bary_mul_balance_with_mulfunc(), bary_mul_karatsuba(), bary_mul_toom3(), bigadd(), bigdivrem1(), and str2big_karatsuba().
|
static |
Definition at line 1428 of file bignum.c.
References BIGLO.
Referenced by bary_mul_karatsuba(), and rb_big_comp().
|
static |
Definition at line 1376 of file bignum.c.
References assert, BDIGIT, BDIGIT_DBL, BIGDN, and BIGLO.
Referenced by bary_add(), and bary_mul_karatsuba().
Definition at line 381 of file bignum.c.
References BARY_TRUNC, and BDIGIT.
Referenced by big2str_karatsuba(), and rb_big_cmp().
|
static |
Definition at line 2826 of file bignum.c.
References assert, bary2bdigitdbl(), bary_divmod_branch(), BARY_TRUNC, BDIGIT, BDIGIT_DBL, BDIGITS_ZERO, bigdivrem_single(), BIGDN, BIGLO, MEMCPY, and rb_num_zerodiv().
|
static |
Definition at line 2814 of file bignum.c.
References bary_divmod_normal(), and GMP_DIV_DIGITS.
Referenced by bary_divmod(), and bigdivrem().
|
static |
Definition at line 2637 of file bignum.c.
References ALLOCV_END, ALLOCV_N, assert, bary_small_lshift(), bary_small_rshift(), BDIGIT, BDIGITS_ZERO, BIGDIVREM_EXTRA_WORDS, bigdivrem_restoring(), MEMCPY, MEMMOVE, nlz(), shift(), big_div_struct::yn, big_div_struct::zds, and big_div_struct::zn.
Referenced by bary_divmod_branch(), and rb_big_divrem_normal().
|
static |
Definition at line 2488 of file bignum.c.
References bary_mul_toom3_start, bary_short_mul(), bary_sq_fast(), GMP_MUL_DIGITS, KARATSUBA_MUL_DIGITS, and NULL.
Referenced by bigmul0(), bigsq(), and str2big_karatsuba().
|
static |
Definition at line 1620 of file bignum.c.
References ALLOCV_END, ALLOCV_N, assert, bary_add(), BDIGIT, BDIGITS_ZERO, KARATSUBA_BALANCED, MEMCPY, and TOOM3_BALANCED.
Referenced by bary_mul_karatsuba_branch(), bary_mul_toom3_branch(), and rb_big_mul_balance().
|
static |
Definition at line 1680 of file bignum.c.
References ALLOCV_END, ALLOCV_N, assert, bary_2comp(), bary_add(), bary_add_one(), bary_addc(), bary_mul_karatsuba_start, bary_muladd_1xN(), bary_sub(), bary_sub_one(), BDIGIT, and MEMCPY.
Referenced by bary_mul_karatsuba_branch(), and rb_big_mul_karatsuba().
|
static |
Definition at line 2424 of file bignum.c.
References bary_mul_balance_with_mulfunc(), bary_mul_karatsuba(), bary_short_mul(), bary_sparse_p(), bary_sq_fast(), KARATSUBA_BALANCED, and KARATSUBA_MUL_DIGITS.
Referenced by bary_mul_karatsuba_start(), and bary_mul_toom3_branch().
|
static |
Definition at line 2454 of file bignum.c.
References bary_mul_karatsuba_branch(), and bary_mul_precheck().
|
static |
Definition at line 1527 of file bignum.c.
References assert, bary_muladd_1xN(), and BDIGITS_ZERO.
Referenced by bary_mul_precheck(), bary_short_mul(), and rb_big_mul_normal().
|
static |
Definition at line 2326 of file bignum.c.
References assert, bary_mul_normal(), bary_small_lshift(), BDIGIT, BDIGITS_ZERO, bit_length, MEMCPY, and POW2_P.
Referenced by bary_mul_karatsuba_start(), and bary_mul_toom3_start().
Definition at line 1440 of file bignum.c.
References assert, BDIGIT_DBL, bdigitdbl2bary(), and BDIGITS_ZERO.
Referenced by bary_short_mul().
|
static |
Definition at line 1862 of file bignum.c.
References ALLOCV_END, ALLOCV_N, assert, bary_2comp(), bary_add(), bary_mul_toom3_start, bary_muladd_1xN(), bary_mulsub_1xN(), bary_small_lshift(), bary_small_rshift(), bary_sub(), BARY_TRUNC, BDIGIT, BDIGITS_ZERO, bigdivrem_single(), and MEMCPY.
Referenced by bary_mul_toom3_branch(), and rb_big_mul_toom3().
|
static |
Definition at line 2463 of file bignum.c.
References bary_mul_balance_with_mulfunc(), bary_mul_karatsuba_branch(), bary_mul_toom3(), TOOM3_BALANCED, and TOOM3_MUL_DIGITS.
Referenced by bary_mul_toom3_start().
|
static |
Definition at line 2479 of file bignum.c.
References bary_mul_precheck(), and bary_mul_toom3_branch().
|
static |
Definition at line 1452 of file bignum.c.
References assert, BDIGIT_DBL, BDIGIT_DBL_SIGNED, BIGDN, and BIGLO.
Referenced by bary_mul_karatsuba(), bary_mul_normal(), and bary_mul_toom3().
|
static |
Definition at line 1513 of file bignum.c.
References assert, BDIGIT_DBL_SIGNED, bigdivrem_mulsub(), BIGDN, and BIGLO.
Referenced by bary_mul_toom3().
|
static |
|
static |
Definition at line 627 of file bignum.c.
References ALIGNOF, bary_2comp(), bary_swap(), BDIGIT, BDIGIT_DBL, BDIGIT_DBL_SIGNED, BDIGITS_ZERO, buf, bytes_2comp(), CHAR_BIT, CLEAR_LOWBITS, dp, FILL_DD, FILL_LOWBITS, HOST_BIGENDIAN_P, INTEGER_PACK_2COMP, INTEGER_PACK_BYTEORDER_MASK, INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION, integer_pack_loop_setup(), INTEGER_PACK_LSBYTE_FIRST, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_MSBYTE_FIRST, INTEGER_PACK_MSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, INTEGER_PACK_WORDORDER_MASK, MEMCPY, MEMZERO, POW2_P, SIZEOF_BDIGIT, swap16, swap32, TAKE_LOWBITS, and validate_integer_pack_format().
Referenced by absint_numwords_generic(), and rb_integer_pack().
|
static |
Definition at line 2299 of file bignum.c.
References assert, bary_mul_normal(), bary_mul_single(), and rb_thread_check_ints().
Referenced by bary_mul(), and bary_mul_karatsuba_branch().
Definition at line 399 of file bignum.c.
References assert, BDIGIT_DBL, BIGDN, BIGLO, and BITSPERDIG.
Referenced by bary_divmod_normal(), bary_mul_precheck(), bary_mul_toom3(), big2str_karatsuba(), and big_shift3().
|
static |
Definition at line 414 of file bignum.c.
References assert, BDIGIT, BDIGIT_DBL, BIGLO, BIGUP, and BITSPERDIG.
Referenced by bary_divmod_normal(), bary_mul_toom3(), big2str_karatsuba(), big_shift3(), and bigdivrem_single1().
Definition at line 2314 of file bignum.c.
References rb_genrand_ulong_limited().
Referenced by bary_mul_karatsuba_branch().
Definition at line 1555 of file bignum.c.
References assert, BDIGIT, BDIGIT_DBL, BDIGITS_ZERO, BIGDN, and BIGLO.
Referenced by bary_mul(), bary_mul_karatsuba_branch(), bigsq(), and rb_big_sq_fast().
|
static |
Definition at line 1364 of file bignum.c.
References bary_subb().
Referenced by bary_mul_karatsuba(), bary_mul_toom3(), and bigsub().
|
static |
Definition at line 1370 of file bignum.c.
References bary_subb(), and NULL.
Referenced by bary_mul_karatsuba().
|
static |
Definition at line 1313 of file bignum.c.
References assert, BDIGIT_DBL_SIGNED, BDIGMAX, BIGDN, and BIGLO.
Referenced by bary_sub(), and bary_sub_one().
|
static |
Definition at line 470 of file bignum.c.
References BDIGIT.
Referenced by bary_pack(), and bary_unpack_internal().
|
static |
Definition at line 1281 of file bignum.c.
References assert, bary_unpack_internal(), BDIGITS_ZERO, 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, integer_unpack_num_bdigits(), and validate_integer_pack_format().
Referenced by absint_numwords_generic(), and rb_big_bit_length().
|
static |
Definition at line 1081 of file bignum.c.
References ALIGNOF, assert, bary_2comp(), bary_swap(), bary_zero_p(), BDIGIT, BDIGIT_DBL, BDIGIT_MSB, BDIGMAX, BIGLO, BITSPERDIG, buf, CHAR_BIT, dp, HOST_BIGENDIAN_P, INTEGER_PACK_2COMP, INTEGER_PACK_BYTEORDER_MASK, INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION, integer_pack_loop_setup(), INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_MSBYTE_FIRST, INTEGER_PACK_MSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, INTEGER_PACK_NEGATIVE, INTEGER_PACK_WORDORDER_MASK, integer_unpack_single_bdigit(), MEMCPY, MEMZERO, PUSH_BITS, SIZEOF_BDIGIT, swap16, and swap32.
Referenced by bary_unpack(), and rb_integer_unpack().
|
static |
Definition at line 431 of file bignum.c.
Referenced by bary_unpack_internal(), big2str_karatsuba(), big_shift3(), bigzero_p(), and rb_integer_unpack().
|
inlinestatic |
Definition at line 372 of file bignum.c.
References assert, BDIGIT, BIGDN, and BIGLO.
Referenced by bary_mul_single(), and power_cache_get_power().
|
static |
Definition at line 5199 of file bignum.c.
References BDIGIT, BDIGITS, BDIGMAX, BIGLO, BIGNUM_LEN, BIGNUM_NEGATIVE_P, BIGRAD, bigtrunc(), BITSPERDIG, DBL_MANT_DIG, DBL_MAX_EXP, lo, and nlz().
Referenced by big_fdiv(), rb_big2dbl(), and rb_big_fdiv_double().
|
static |
Definition at line 4678 of file bignum.c.
References assert, bary2bdigitdbl(), big2str_struct::base, BDIGIT_DBL, big2str_alloc(), buf, CHAR_BIT, big2str_struct::hbase2_numdigits, len, MEMCPY, big2str_struct::ptr, ruby_digitmap, and SIZEOF_BDIGIT_DBL.
Referenced by big2str_generic(), and big2str_karatsuba().
|
static |
Definition at line 4667 of file bignum.c.
References LONG_MAX, big2str_struct::negative, big2str_struct::ptr, rb_eArgError, rb_raise(), rb_usascii_str_new(), big2str_struct::result, and RSTRING_PTR.
Referenced by big2str_2bdigits().
Definition at line 4840 of file bignum.c.
References BIGNUM_NEGATIVE_P, BIGNUM_POSITIVE_P, CHAR_BIT, ffs(), INTEGER_PACK_BIG_ENDIAN, LONG_MAX, NULL, rb_absint_numwords(), rb_eArgError, rb_integer_pack(), rb_raise(), rb_usascii_str_new(), result, RSTRING_PTR, and ruby_digitmap.
Referenced by rb_big2str1(), and rb_big2str_poweroftwo().
Definition at line 4877 of file bignum.c.
References ALLOCV_END, ALLOCV_N, assert, BARY_TRUNC, big2str_struct::base, BDIGIT, BDIGITS, big2str_2bdigits(), big2str_karatsuba(), BIGDIVREM_EXTRA_WORDS, BIGNUM_LEN, BIGNUM_NEGATIVE_P, BITSPERDIG, big2str_struct::hbase2, big2str_struct::hbase2_numdigits, invalid_radix(), LONG_MAX, MAX_BASE36_POWER_TABLE_ENTRIES, maxpow_in_bdigit_dbl(), MEMCPY, big2str_struct::negative, NULL, power_cache_get_power(), big2str_struct::ptr, Qnil, rb_eRangeError, RB_GC_GUARD, rb_raise(), rb_str_resize(), rb_usascii_str_new2, big2str_struct::result, RSTRING_PTR, and valid_radix_p().
Referenced by rb_big2str1(), and rb_big2str_generic().
|
static |
Definition at line 4717 of file bignum.c.
References assert, bary_cmp(), bary_small_lshift(), bary_small_rshift(), BARY_TRUNC, bary_zero_p(), big2str_struct::base, BDIGIT, BDIGITS, big2str_2bdigits(), BIGDIVREM_EXTRA_WORDS, bigdivrem_restoring(), BIGNUM_LEN, len, nlz(), power_cache_get_power(), big2str_struct::ptr, and shift().
Referenced by big2str_generic().
Definition at line 5047 of file bignum.c.
References BDIGIT, BDIGITS, BIGNUM_LEN, BIGSIZE, BITSPERDIG, len, rb_eRangeError, and rb_raise().
Referenced by rb_big2long(), rb_big2ulong(), and rb_big_aref().
|
static |
Definition at line 3014 of file bignum.c.
References BDIGITS, BIGNUM_LEN, and rb_big_resize().
Referenced by get2comp(), rb_big_comp(), and rb_integer_unpack().
Definition at line 6092 of file bignum.c.
References BDIGITS, big2dbl(), big_shift(), bigdivrem(), BIGNUM_LEN, bigtrunc(), BITSPERDIG, DBL_BIGDIG, INFINITY, and nlz().
Referenced by big_fdiv_float(), and big_fdiv_int().
Definition at line 6131 of file bignum.c.
References big_fdiv(), dbl2big(), DBL_MANT_DIG, and RFLOAT_VALUE.
Referenced by rb_big_fdiv_double().
Definition at line 6119 of file bignum.c.
References BDIGITS, big_fdiv(), big_shift(), BIGNUM_LEN, bigtrunc(), BITSPERDIG, DBL_BIGDIG, and nlz().
Referenced by rb_big_fdiv_double().
Definition at line 4582 of file bignum.c.
References big_shift3(), and BITSPERDIG.
Referenced by big_shift().
Definition at line 5381 of file bignum.c.
References big_op_ge, big_op_gt, big_op_le, big_op_lt, FIX2INT, NIL_P, Qfalse, Qtrue, Qundef, rb_big_cmp(), RB_FLOAT_TYPE_P, rb_integer_float_cmp(), RB_INTEGER_TYPE_P, rb_intern, and rb_num_coerce_relop().
Referenced by rb_big_ge(), rb_big_gt(), rb_big_le(), and rb_big_lt().
Definition at line 4590 of file bignum.c.
References big_shift3(), and BITSPERDIG.
Referenced by big_shift().
Definition at line 6082 of file bignum.c.
References big_lshift(), and big_rshift().
Referenced by big_fdiv(), and big_fdiv_int().
Definition at line 4549 of file bignum.c.
References assert, big_shift3(), BIGNUM_POSITIVE_P, BIGZEROP, bit_length, BITSPERDIG, CHAR_BIT, INT2FIX, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, numberof, POW2_P, rb_eRangeError, rb_integer_pack(), rb_raise(), and SIZEOF_SIZE_T.
Referenced by rb_big_lshift(), and rb_big_rshift().
Definition at line 4500 of file bignum.c.
References abs2twocomp(), bary_small_lshift(), bary_small_rshift(), bary_zero_p(), BDIGIT, BDIGITS, BDIGITS_ZERO, BDIGMAX, bignew, BIGNUM_LEN, BIGNUM_POSITIVE_P, BIGNUM_SIGN, INT2FIX, LONG_MAX, rb_eArgError, RB_GC_GUARD, rb_raise(), twocomp2abs_bang(), big_div_struct::zds, and big_div_struct::zn.
Referenced by big_lshift(), big_rshift(), big_shift2(), rb_big_lshift(), and rb_big_rshift().
Definition at line 5724 of file bignum.c.
References bary_add(), BDIGITS, bignew, BIGNUM_LEN, BIGNUM_SIGN, bigsub(), and len.
Referenced by bigdivmod(), rb_big_minus(), and rb_big_plus().
Definition at line 5641 of file bignum.c.
References BDIGIT, BDIGIT_DBL, bdigit_roomof, BDIGITS, BIGDN, BIGLO, bignew, bignorm(), BIGNUM_LEN, BIGNUM_SIGN, LONG2NUM, RB_GC_GUARD, big_div_struct::zds, and big_div_struct::zn.
Referenced by bigsub(), rb_big_minus(), and rb_big_plus().
Definition at line 6228 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BDIGMAX, BIGDN, BIGLO, bignew, bignorm(), INT2FIX, LONG2NUM, RB_GC_GUARD, twocomp2abs_bang(), big_div_struct::zds, and big_div_struct::zn.
Referenced by rb_big_and().
Definition at line 5978 of file bignum.c.
References bigadd(), bigdivrem(), BIGNUM_SIGN, BIGZEROP, mod, and rb_int2big().
Referenced by rb_big_divide(), rb_big_divmod(), and rb_big_modulo().
Definition at line 5885 of file bignum.c.
References bary2bdigitdbl(), bary_divmod_branch(), BARY_TRUNC, BDIGIT, BDIGIT_DBL, bdigit_roomof, BDIGITS, BIGDIVREM_EXTRA_WORDS, bigdivrem_single(), BIGDN, BIGLO, bignew, BIGNUM_LEN, BIGNUM_SET_SIGN, BIGNUM_SIGN, bigtrunc(), NULL, Qnil, rb_int2big(), rb_num_zerodiv(), rb_uint2big(), big_div_struct::yds, big_div_struct::yn, and big_div_struct::zds.
Referenced by big_fdiv(), bigdivmod(), and rb_big_remainder().
|
static |
Definition at line 2525 of file bignum.c.
References bary_add(), BDIGIT, BDIGIT_DBL_SIGNED, BDIGMAX, bigdivrem_mulsub(), BIGUP, big_div_struct::stop, big_div_struct::yds, big_div_struct::yn, big_div_struct::zds, and big_div_struct::zn.
Referenced by bigdivrem_restoring().
|
static |
Definition at line 1487 of file bignum.c.
References assert, BDIGIT_DBL, BDIGIT_DBL_SIGNED, BIGDN, and BIGLO.
Referenced by bary_mulsub_1xN(), and bigdivrem1().
Definition at line 2598 of file bignum.c.
References assert, BDIGIT, BDIGIT_MSB, bigdivrem1(), bigdivrem_single1(), Qfalse, Qtrue, rb_big_stop(), rb_thread_call_without_gvl(), big_div_struct::stop, big_div_struct::yds, big_div_struct::yn, big_div_struct::zds, and big_div_struct::zn.
Referenced by bary_divmod_normal(), and big2str_karatsuba().
Definition at line 2592 of file bignum.c.
References bigdivrem_single1().
Referenced by bary_divmod(), bary_mul_toom3(), and bigdivrem().
|
static |
Definition at line 2567 of file bignum.c.
References assert, bary_small_rshift(), BDIGIT, BDIGIT_DBL, BIGUP, bit_length, and POW2_P.
Referenced by bigdivrem_restoring(), and bigdivrem_single().
Definition at line 3083 of file bignum.c.
References BARY_TRUNC, BDIGIT, BDIGITS, BIGNUM_LEN, BIGNUM_POSITIVE_P, BIGUP, FIXNUM_MIN, INT2FIX, LONG2FIX, POSFIXABLE, rb_big_resize(), and SIZEOF_BDIGIT.
Referenced by bignorm(), and rb_big_cmp().
Definition at line 5840 of file bignum.c.
References bary_mul(), BDIGIT, BDIGITS, bignew, BIGNUM_LEN, BIGNUM_SIGN, bigsq(), RB_GC_GUARD, big_div_struct::yds, big_div_struct::yn, big_div_struct::zds, and big_div_struct::zn.
Referenced by rb_big_mul(), and rb_big_pow().
Definition at line 2980 of file bignum.c.
References ALLOC_N, BDIGIT, BIGNUM_EMBED_FLAG, BIGNUM_EMBED_LEN_MAX, BIGNUM_SET_LEN, BIGNUM_SET_SIGN, FL_WB_PROTECTED, len, NEWOBJ_OF, OBJ_FREEZE, RBASIC, RBIGNUM, RGENGC_WB_PROTECTED_BIGNUM, T_BIGNUM, and VALGRIND_MAKE_MEM_UNDEFINED.
Referenced by abs2twocomp(), and rb_big_clone().
Definition at line 3127 of file bignum.c.
References bigfixize(), and RB_BIGNUM_TYPE_P.
Referenced by bigadd_int(), bigand_int(), bigor_int(), bigsub_int(), bigxor_int(), rb_big_and(), rb_big_comp(), rb_big_divide(), rb_big_divmod(), rb_big_eq(), rb_big_lshift(), rb_big_minus(), rb_big_modulo(), rb_big_mul(), rb_big_norm(), rb_big_or(), rb_big_plus(), rb_big_pow(), rb_big_remainder(), rb_big_rshift(), rb_big_uminus(), rb_big_xor(), rb_cstr_parse_inum(), rb_dbl2big(), rb_integer_unpack(), rb_str2big_karatsuba(), rb_str2big_normal(), and rb_str2big_poweroftwo().
Definition at line 6334 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BDIGMAX, BIGDN, BIGLO, bignew, bignorm(), BIGNUM_LEN, INT2FIX, LONG2FIX, RB_GC_GUARD, twocomp2abs_bang(), big_div_struct::zds, and big_div_struct::zn.
Referenced by rb_big_or().
Definition at line 5809 of file bignum.c.
References bary_mul(), bary_sq_fast(), BDIGIT, BDIGITS, bignew, BIGNUM_LEN, GMP_MUL_DIGITS, KARATSUBA_MUL_DIGITS, RB_GC_GUARD, big_div_struct::zds, and big_div_struct::zn.
Referenced by bigmul0(), power_cache_get_power(), and rb_big_pow().
Definition at line 5517 of file bignum.c.
References bary_2comp(), bary_sub(), BDIGIT, BDIGITS, bigadd_int(), bignew, BIGNUM_LEN, BIGNUM_SET_NEGATIVE_SIGN, big_div_struct::yds, big_div_struct::yn, big_div_struct::zds, and big_div_struct::zn.
Referenced by bigadd().
Definition at line 5544 of file bignum.c.
References assert, BDIGIT, BDIGIT_DBL_SIGNED, bdigit_roomof, BDIGITS, BIGDN, BIGLO, bignew, bignorm(), BIGNUM_LEN, BIGNUM_NEGATE, BIGNUM_SIGN, get2comp(), LONG2NUM, RB_GC_GUARD, big_div_struct::zds, and big_div_struct::zn.
Referenced by rb_big_minus(), and rb_big_plus().
Definition at line 3069 of file bignum.c.
References BDIGIT, BDIGITS, BIGNUM_LEN, len, and rb_big_resize().
Referenced by big2dbl(), big_fdiv(), big_fdiv_int(), bigdivrem(), power_cache_get_power(), rb_big2str1(), rb_big_aref(), rb_big_divrem_normal(), rb_big_pow(), and rb_integer_unpack().
Definition at line 6453 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BDIGMAX, BIGDN, BIGLO, bignew, bignorm(), BIGNUM_LEN, RB_GC_GUARD, twocomp2abs_bang(), big_div_struct::zds, and big_div_struct::zn.
Referenced by rb_big_xor().
|
static |
Definition at line 2897 of file bignum.c.
References bary_zero_p(), BDIGITS, and BIGNUM_LEN.
|
static |
|
static |
Definition at line 5161 of file bignum.c.
References BDIGIT, BDIGITS, bignew, BIGRAD, isinf(), isnan, rb_eFloatDomainError, and rb_raise().
Referenced by big_fdiv_float(), and rb_dbl2big().
|
static |
Definition at line 3022 of file bignum.c.
References bary_2comp(), BDIGIT, BDIGITS, big_extend_carry(), and BIGNUM_LEN.
Referenced by bigsub_int(), rb_big_2comp(), and twocomp2abs_bang().
void Init_Bignum | ( | void | ) |
Definition at line 6790 of file bignum.c.
References power_cache_init(), rb_cBignum, rb_cInteger, rb_cObject, rb_define_const(), rb_define_method(), rb_deprecate_constant(), rb_int_coerce(), and rb_sprintf().
|
inlinestatic |
Definition at line 588 of file bignum.c.
References BDIGIT_DBL, BITSPERDIG, and CHAR_BIT.
|
static |
Definition at line 523 of file bignum.c.
References CHAR_BIT, INTEGER_PACK_BYTEORDER_MASK, INTEGER_PACK_LSBYTE_FIRST, INTEGER_PACK_MSBYTE_FIRST, INTEGER_PACK_MSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and INTEGER_PACK_WORDORDER_MASK.
Referenced by bary_pack(), and bary_unpack_internal().
|
inlinestatic |
Definition at line 601 of file bignum.c.
References BDIGIT_DBL.
|
static |
Definition at line 1028 of file bignum.c.
References assert, BITSPERDIG, CHAR_BIT, integer_unpack_num_bdigits_generic(), integer_unpack_num_bdigits_small(), and SIZE_MAX.
Referenced by bary_unpack(), and rb_integer_unpack().
|
static |
Definition at line 968 of file bignum.c.
References BITSPERDIG, CHAR_BIT, r1, r2, and r3.
Referenced by integer_unpack_num_bdigits().
|
static |
Definition at line 958 of file bignum.c.
References BITSPERDIG, and CHAR_BIT.
Referenced by integer_unpack_num_bdigits().
|
inlinestatic |
Definition at line 1050 of file bignum.c.
References BDIGIT_DBL, BIGDN, BIGLO, and BITSPERDIG.
Definition at line 1062 of file bignum.c.
References BDIGMAX, BIGLO, CHAR_BIT, INTEGER_PACK_2COMP, INTEGER_PACK_NEGATIVE, LSHIFTX, and SIZEOF_BDIGIT.
Referenced by bary_unpack_internal().
|
inlinestatic |
Definition at line 3706 of file bignum.c.
References PRIsVALUE, rb_eArgError, and rb_raise().
Referenced by rb_str2big_karatsuba(), rb_str2big_normal(), rb_str2big_poweroftwo(), and rb_str_to_inum().
|
inlinestatic |
Definition at line 3700 of file bignum.c.
References rb_eArgError, and rb_raise().
Referenced by big2str_generic(), rb_big2str1(), rb_cstr_parse_inum(), rb_str2big_karatsuba(), rb_str2big_normal(), and rb_str2big_poweroftwo().
|
static |
Definition at line 325 of file bignum.c.
References assert, BDIGIT_DBL, and BDIGIT_DBL_MAX.
Referenced by big2str_generic(), power_cache_get_power(), rb_cstr_parse_inum(), rb_str2big_karatsuba(), and rb_str2big_normal().
|
static |
Definition at line 159 of file bignum.c.
References BDIGIT, CHAR_BIT, nlz_int(), nlz_long(), and SIZEOF_BDIGIT.
Referenced by bary_divmod_normal(), big2dbl(), big2str_karatsuba(), big_fdiv(), big_fdiv_int(), random_ulong_limited_big(), and rb_absint_size().
NORETURN | ( | static inline void | invalid_radixint base | ) |
NORETURN | ( | static inline void | invalid_integerVALUE s | ) |
|
inlinestatic |
Definition at line 4614 of file bignum.c.
References BDIGIT_DBL, bdigitdbl2bary(), BDIGITS, bignew, bigsq(), bigtrunc(), MAX_BASE36_POWER_TABLE_ENTRIES, maxpow_in_bdigit_dbl(), NIL_P, rb_bug(), rb_gc_register_mark_object(), and rb_obj_hide().
Referenced by big2str_generic(), big2str_karatsuba(), and str2big_karatsuba().
|
static |
Definition at line 4603 of file bignum.c.
References MAX_BASE36_POWER_TABLE_ENTRIES, and Qnil.
Referenced by Init_Bignum().
size_t rb_absint_numwords | ( | VALUE | val, |
size_t | word_numbits, | ||
size_t * | nlz_bits_ret | ||
) |
Definition at line 3366 of file bignum.c.
References absint_numwords_generic(), absint_numwords_small(), assert, CHAR_BIT, rb_absint_size(), and SIZE_MAX.
Referenced by big2str_base_poweroftwo(), get_double_rshift(), limited_big_rand(), pack_pack(), rand_init(), random_ulong_limited_big(), rb_big_pow(), and rb_str_format().
int rb_absint_singlebit_p | ( | VALUE | val | ) |
Definition at line 3430 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, BIGNUM_LEN, dp, FIX2LONG, FIXNUM_P, numberof, POW2_P, and rb_to_int().
Referenced by rb_big_bit_length(), and rb_str_format().
size_t rb_absint_size | ( | VALUE | val, |
int * | nlz_bits_ret | ||
) |
Definition at line 3231 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, BIGNUM_LEN, CHAR_BIT, dp, FIX2LONG, FIXNUM_P, nlz(), numberof, rb_to_int(), and SIZEOF_BDIGIT.
Referenced by integer_to_bnptr(), rb_absint_numwords(), rb_big_bit_length(), rb_num_to_uint(), and v2w().
double rb_big2dbl | ( | VALUE | x | ) |
Definition at line 5249 of file bignum.c.
References big2dbl(), isinf(), and rb_warning().
Referenced by flo_div(), flo_divmod(), flo_minus(), flo_mod(), flo_mul(), flo_plus(), int_to_f(), ole_val2ptr_variant(), ole_val2variant(), rb_ary_sum(), rb_big_divide(), rb_big_fdiv_double(), rb_big_minus(), rb_big_mul(), rb_big_plus(), rb_big_pow(), rb_float_pow(), and sum_iter().
long rb_big2long | ( | VALUE | x | ) |
Definition at line 5087 of file bignum.c.
References BDIGIT, BDIGITS, big2ulong(), BIGNUM_LEN, BIGNUM_POSITIVE_P, BIGSIZE, BIGUP, len, LONG_MAX, LONG_MIN, rb_eRangeError, and rb_raise().
Referenced by rb_num2long().
Definition at line 5041 of file bignum.c.
References rb_big2str1().
Referenced by format_value(), GetVpValueWithPrec(), rb_int2str(), and rb_str_format().
Definition at line 5001 of file bignum.c.
References BARY_TRUNC, BDIGIT, BDIGITS, big2str_base_poweroftwo(), big2str_generic(), BIGNUM_LEN, bigtrunc(), BITSPERDIG, FIXNUM_P, GMP_BIG2STR_DIGITS, invalid_radix(), LONG_MAX, POW2_P, rb_eRangeError, rb_fix2str(), rb_raise(), rb_usascii_str_new2, and valid_radix_p().
Referenced by rb_big2str().
Definition at line 4954 of file bignum.c.
References BDIGIT, BDIGITS, big2str_generic(), BIGNUM_LEN, BIGNUM_NEGATIVE_P, CHAR_BIT, RB_GC_GUARD, rb_str_set_len(), rb_usascii_str_new(), RSTRING_LEN, RSTRING_PTR, size, and SIZEOF_BDIGIT.
Definition at line 4871 of file bignum.c.
References big2str_base_poweroftwo().
unsigned long rb_big2ulong | ( | VALUE | x | ) |
Definition at line 5072 of file bignum.c.
References big2ulong(), BIGNUM_POSITIVE_P, LONG_MIN, rb_eRangeError, and rb_raise().
Referenced by rb_num2ulong_internal(), and rb_num_to_uint().
void rb_big_2comp | ( | VALUE | x | ) |
Definition at line 3033 of file bignum.c.
References BDIGIT, and get2comp().
Definition at line 6685 of file bignum.c.
References BIGNUM_NEGATIVE_P, BIGNUM_SET_POSITIVE_SIGN, and rb_big_clone().
Referenced by rb_int_abs().
Definition at line 6283 of file bignum.c.
References abs2twocomp(), BDIGIT, BDIGITS, bigand_int(), bignew, bignorm(), FIX2LONG, FIXNUM_P, RB_GC_GUARD, RB_INTEGER_TYPE_P, rb_num_coerce_bit(), twocomp2abs_bang(), big_div_struct::yn, and big_div_struct::zds.
Referenced by fix_and(), and rb_int_and().
Definition at line 6604 of file bignum.c.
References BDIGIT, BDIGITS, big2ulong(), BIGNUM_LEN, BIGNUM_NEGATIVE_P, BIGNUM_POSITIVE_P, BIGNUM_SIGN, BIGSIZE, bigtrunc(), BITSPERDIG, INT2FIX, NUM2LONG, RB_BIGNUM_TYPE_P, and shift().
Referenced by int_aref().
Definition at line 6713 of file bignum.c.
References BARY_ARGS, BARY_SHORT_MUL, BARY_SUB, bary_unpack(), BDIGIT, bdigit_roomof, BIGNUM_NEGATIVE_P, 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 3004 of file bignum.c.
References BDIGIT, BDIGITS, bignew_1(), BIGNUM_LEN, BIGNUM_SIGN, CLASS_OF, len, and MEMCPY.
Referenced by rb_big_abs(), rb_big_comp(), and rb_big_uminus().
Definition at line 5346 of file bignum.c.
References bary_cmp(), BDIGITS, bigfixize(), BIGNUM_LEN, BIGNUM_SIGN, cmp(), FIXNUM_P, INT2FIX, RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_integer_float_cmp(), rb_intern, rb_num_coerce_cmp(), and SIGNED_VALUE.
Referenced by big_op(), BigMath_s_log(), fix_cmp(), fix_ge(), fix_gt(), fix_le(), fix_lt(), is_negative(), rb_int_cmp(), and rb_integer_float_cmp().
Definition at line 5491 of file bignum.c.
References bary_add_one(), bary_neg(), BDIGIT, BDIGITS, big_extend_carry(), bignorm(), BIGNUM_LEN, BIGNUM_POSITIVE_P, BIGNUM_SET_NEGATIVE_SIGN, BIGNUM_SET_POSITIVE_SIGN, INT2FIX, and rb_big_clone().
Referenced by int_comp().
Definition at line 6022 of file bignum.c.
References rb_big_divide().
Referenced by fix_divide(), and rb_int_div().
Definition at line 5994 of file bignum.c.
References bigdivmod(), bignorm(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, rb_dbl2big(), RB_FLOAT_TYPE_P, rb_int2big(), rb_num_coerce_bin(), rb_num_zerodiv(), and RFLOAT_VALUE.
Referenced by rb_big_div(), and rb_big_idiv().
Definition at line 6066 of file bignum.c.
References bigdivmod(), bignorm(), div, FIX2LONG, FIXNUM_P, mod, rb_assoc_new(), RB_BIGNUM_TYPE_P, rb_int2big(), rb_intern, and rb_num_coerce_bin().
Referenced by fix_divmod(), and rb_int_divmod().
Definition at line 2698 of file bignum.c.
References assert, bary_divmod_normal(), BARY_TRUNC, BDIGIT, BDIGITS, BDIGITS_ZERO, BIGDIVREM_EXTRA_WORDS, bignew, BIGNUM_LEN, BIGNUM_SIGN, bigtrunc(), CHAR_BIT, count, LONG2FIX, rb_assoc_new(), RB_GC_GUARD, rb_num_zerodiv(), SIZEOF_BDIGIT, and big_div_struct::yn.
Definition at line 5451 of file bignum.c.
References BDIGIT, BDIGITS, bignorm(), BIGNUM_LEN, BIGNUM_SIGN, FIXNUM_P, MEMCMP, Qfalse, Qtrue, RB_BIGNUM_TYPE_P, rb_equal(), RB_FLOAT_TYPE_P, and rb_integer_float_eq().
Referenced by fix_equal(), rb_int_equal(), and rb_integer_float_eq().
Definition at line 5471 of file bignum.c.
References BDIGIT, BDIGITS, BIGNUM_LEN, BIGNUM_SIGN, MEMCMP, Qfalse, Qtrue, and RB_BIGNUM_TYPE_P.
Referenced by num_eql().
Definition at line 6763 of file bignum.c.
References BDIGITS, BIGNUM_LEN, Qfalse, and Qtrue.
Referenced by int_even_p().
Definition at line 6168 of file bignum.c.
References DBL2NUM, and rb_big_fdiv_double().
Definition at line 6139 of file bignum.c.
References big2dbl(), big_fdiv_float(), big_fdiv_int(), FIX2LONG, FIXNUM_P, isinf(), isnan, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_int2big(), rb_intern, rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by fix_fdiv_double(), rb_big_fdiv(), and rb_int_fdiv_double().
Definition at line 5422 of file bignum.c.
References big_op(), and big_op_ge.
Referenced by rb_int_ge().
Definition at line 5416 of file bignum.c.
References big_op(), and big_op_gt.
Referenced by rb_int_gt().
Definition at line 6649 of file bignum.c.
References BDIGIT, BDIGITS, BIGNUM_LEN, BIGNUM_SIGN, hash(), rb_memhash(), and ST2FIX.
Referenced by any_hash().
Definition at line 6028 of file bignum.c.
References rb_big_divide(), and rb_intern.
Referenced by rb_int_idiv().
Definition at line 6544 of file bignum.c.
References big_shift2(), big_shift3(), bignorm(), bit_length, BITSPERDIG, FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_to_int(), and shift().
Referenced by fix_lshift(), rb_fix_lshift(), and rb_int_lshift().
Definition at line 5780 of file bignum.c.
References bigadd(), bigadd_int(), bignorm(), BIGNUM_SIGN, bigsub_int(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by fix_minus(), int_range_sum(), rand_int(), rand_range(), rb_int_minus(), rb_int_pred(), sub(), and wsub().
Definition at line 6034 of file bignum.c.
References bigdivmod(), bignorm(), FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_int2big(), and rb_num_coerce_bin().
Referenced by fix_mod(), mod(), and rb_int_modulo().
Definition at line 5867 of file bignum.c.
References bigmul0(), bignorm(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_int2big(), rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by f_imul(), fix_mul(), int_pow(), mul(), rb_fix_mul_fix(), and rb_int_mul().
Definition at line 1668 of file bignum.c.
References bary_mul_balance_with_mulfunc(), BDIGITS, bignew, BIGNUM_LEN, BIGNUM_SIGN, NULL, and RB_GC_GUARD.
Definition at line 1849 of file bignum.c.
References bary_mul_karatsuba(), BDIGITS, bignew, BIGNUM_LEN, BIGNUM_SIGN, KARATSUBA_BALANCED, NULL, rb_eArgError, RB_GC_GUARD, and rb_raise().
Definition at line 1540 of file bignum.c.
References bary_mul_normal(), BDIGITS, bignew, BIGNUM_LEN, BIGNUM_SIGN, and RB_GC_GUARD.
Definition at line 2246 of file bignum.c.
References assert, bary_mul_toom3(), BDIGIT, BDIGITS, BDIGITS_ZERO, bignew, BIGNUM_LEN, BIGNUM_SIGN, CHAR_BIT, count, NULL, rb_eArgError, RB_GC_GUARD, rb_raise(), SIZEOF_BDIGIT, and TOOM3_BALANCED.
VALUE rb_big_new | ( | size_t | len, |
int | sign | ||
) |
Definition at line 3136 of file bignum.c.
References bignorm().
Referenced by fix_aref(), negate_lit(), rand_range(), and rb_int_digits_bigbase().
Definition at line 6754 of file bignum.c.
References BDIGITS, BIGNUM_LEN, Qfalse, and Qtrue.
Referenced by int_odd_p().
Definition at line 6402 of file bignum.c.
References abs2twocomp(), BDIGIT, BDIGITS, bignew, bignorm(), bigor_int(), FIX2LONG, FIXNUM_P, RB_GC_GUARD, RB_INTEGER_TYPE_P, rb_num_coerce_bit(), twocomp2abs_bang(), big_div_struct::yn, and big_div_struct::zds.
void rb_big_pack | ( | VALUE | val, |
unsigned long * | buf, | ||
long | num_longs | ||
) |
Definition at line 3199 of file bignum.c.
References INTEGER_PACK_2COMP, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and rb_integer_pack().
Referenced by is_even().
Definition at line 5751 of file bignum.c.
References bigadd(), bigadd_int(), bignorm(), BIGNUM_SIGN, bigsub_int(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by add(), ary_inject_op(), enum_sum(), fix_plus(), rand_range(), rb_ary_sum(), rb_int_plus(), rb_int_succ(), sum_iter(), ulong_to_num_plus_1(), and wadd().
Definition at line 6174 of file bignum.c.
References bigmul0(), bignorm(), BIGNUM_NEGATIVE_P, bigsq(), bigtrunc(), BIGZEROP, DBL2NUM, FIX2LONG, FIXNUM_MAX, FIXNUM_P, INT2FIX, NULL, rb_absint_numwords(), rb_big2dbl(), RB_BIGNUM_TYPE_P, rb_complex_raw1, RB_FLOAT_TYPE_P, rb_funcall(), rb_intern, rb_num_coerce_bin(), rb_rational_raw1, rb_warn(), RFLOAT_VALUE, round(), and SIGNED_VALUE.
Referenced by fix_pow(), int_pow(), and rb_int_pow().
|
static |
Definition at line 2938 of file bignum.c.
References ALLOC_N, BDIGIT, BIGNUM_EMBED_FLAG, BIGNUM_EMBED_LEN_MAX, BIGNUM_LEN, BIGNUM_SET_LEN, MEMCPY, RBASIC, RBIGNUM, REALLOC_N, VALGRIND_MAKE_MEM_UNDEFINED, and xfree().
Referenced by rb_big_resize().
Definition at line 6050 of file bignum.c.
References bigdivrem(), bignorm(), FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_int2big(), rb_intern, and rb_num_coerce_bin().
Referenced by int_remainder().
void rb_big_resize | ( | VALUE | big, |
size_t | len | ||
) |
Definition at line 2973 of file bignum.c.
References BIGNUM_SET_LEN, and rb_big_realloc().
Referenced by big_extend_carry(), bigfixize(), and bigtrunc().
Definition at line 6574 of file bignum.c.
References big_shift2(), big_shift3(), bignorm(), bit_length, BITSPERDIG, FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_to_int(), and shift().
Referenced by get_double_rshift(), rb_fix_rshift(), and rb_int_rshift().
int rb_big_sign | ( | VALUE | x | ) |
Definition at line 6695 of file bignum.c.
References BIGNUM_SIGN.
size_t rb_big_size | ( | VALUE | big | ) |
Definition at line 6701 of file bignum.c.
References BIGSIZE.
Referenced by int_round_zero_p(), and rb_big_size_m().
Definition at line 6707 of file bignum.c.
References rb_big_size(), and SIZET2NUM.
Referenced by int_size().
Definition at line 1609 of file bignum.c.
References bary_sq_fast(), BDIGITS, bignew, BIGNUM_LEN, and RB_GC_GUARD.
|
static |
Definition at line 2560 of file bignum.c.
References BDIGIT, Qtrue, and big_div_struct::stop.
Referenced by bigdivrem_restoring().
Definition at line 5481 of file bignum.c.
References bignorm(), BIGNUM_NEGATE, and rb_big_clone().
Referenced by rand_int(), rb_int_uminus(), and rb_str_format().
VALUE rb_big_unpack | ( | unsigned long * | buf, |
long | num_longs | ||
) |
Definition at line 3207 of file bignum.c.
References INTEGER_PACK_2COMP, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and rb_integer_unpack().
Definition at line 6496 of file bignum.c.
References abs2twocomp(), BDIGIT, BDIGITS, bignew, bignorm(), bigxor_int(), FIX2LONG, FIXNUM_P, RB_GC_GUARD, RB_INTEGER_TYPE_P, rb_num_coerce_bit(), twocomp2abs_bang(), big_div_struct::yn, and big_div_struct::zds.
int rb_bigzero_p | ( | VALUE | x | ) |
Definition at line 2903 of file bignum.c.
References BIGZEROP.
Referenced by num_positive_p(), num_zero_p(), rand_int(), and rand_range().
Definition at line 2909 of file bignum.c.
References BIGNUM_SIGN, BIGZEROP, FIX2LONG, FIXNUM_P, INT2FIX, NIL_P, RB_BIGNUM_TYPE_P, rb_cmperr(), rb_funcall(), and RTEST.
Referenced by check_step_domain(), cmp(), cmp_equal(), cmpint(), enum_each_cons_size(), f_gt_p(), flo_cmp(), max_by_i(), max_ii(), min_by_i(), min_ii(), minmax_by_i(), minmax_by_i_update(), minmax_ii(), minmax_ii_update(), nmin_block_cmp(), nmin_cmp(), r_less(), range_bsearch(), range_max(), range_min(), rb_ary_bsearch_index(), rb_ary_max(), rb_ary_min(), rb_invcmp(), ruby_num_interval_step_size(), sort_1(), sort_2(), sort_by_cmp(), and wcmp().
Definition at line 4488 of file bignum.c.
References rb_cstr_to_inum().
Referenced by JSON_parse_integer().
Definition at line 4018 of file bignum.c.
References ADV, ASSERT_LEN, bad, bignorm(), BIGNUM_SET_SIGN, bit_length, conv_digit, GMP_STR2BIG_DIGITS, invalid_radix(), ISSPACE, KARATSUBA_MUL_DIGITS, len, LONG2FIX, maxpow_in_bdigit_dbl(), NULL, POSFIXABLE, POW2_P, Qnil, rb_uint2big(), result, roomof, ruby_scan_digits(), str2big_karatsuba(), str2big_normal(), str2big_poweroftwo(), str2big_scan_digits(), val, and valid_radix_p().
Referenced by rb_cstr_to_inum(), and rb_str_to_inum().
Definition at line 3994 of file bignum.c.
References INT2FIX, NIL_P, NULL, rb_cstr_parse_inum(), and rb_invalid_str().
Referenced by ossl_bn_to_i(), parse_numeric(), parse_rational(), rb_cstr2inum(), read_digits(), and str2num().
VALUE rb_dbl2big | ( | double | d | ) |
Definition at line 5193 of file bignum.c.
References bignorm(), and dbl2big().
Referenced by BigDecimal_power(), case_when_optimizable_literal(), dbl2ival(), fix_divide(), flo_to_i(), float_decode_internal(), rb_big_divide(), rb_convert_to_integer(), rb_integer_float_cmp(), rb_integer_float_eq(), rb_str_format(), and ruby_num_interval_step_size().
VALUE rb_int2big | ( | SIGNED_VALUE | n | ) |
Definition at line 3164 of file bignum.c.
References BIGNUM_SET_NEGATIVE_SIGN, neg, and rb_uint2big().
Referenced by bigdivmod(), bigdivrem(), f_imul(), fix_divide(), fix_divmod(), fix_fdiv_double(), fix_lshift(), fix_minus(), fix_mod(), fix_pow(), int_pow(), rb_big_divide(), rb_big_divmod(), rb_big_fdiv_double(), rb_big_modulo(), rb_big_mul(), rb_big_remainder(), rb_fix_lshift(), rb_fix_mul_fix(), rb_fix_rshift(), rb_int2inum(), rb_int2num_inline(), rb_long2num_inline(), and w_object().
VALUE rb_int2inum | ( | SIGNED_VALUE | n | ) |
Definition at line 3192 of file bignum.c.
References FIXABLE, LONG2FIX, and rb_int2big().
Referenced by dir_each(), and gzfile_reader_rewind().
Definition at line 6672 of file bignum.c.
References rb_assoc_new(), rb_Float(), and RB_INTEGER_TYPE_P.
Referenced by Init_Bignum().
Definition at line 5264 of file bignum.c.
References FIX2LONG, FIXNUM_MAX, FIXNUM_MIN, FIXNUM_P, INT2FIX, isinf(), isnan, Qnil, rb_big_cmp(), rb_dbl2big(), RFLOAT_VALUE, and big_div_struct::yn.
Referenced by big_op(), fix_cmp(), fix_ge(), fix_gt(), fix_le(), fix_lt(), flo_cmp(), flo_ge(), flo_le(), flo_lt(), rb_big_cmp(), and rb_float_gt().
Definition at line 5314 of file bignum.c.
References FIX2LONG, FIXNUM_P, isinf(), isnan, LONG_MAX, LONG_MIN, Qfalse, Qtrue, rb_big_eq(), rb_dbl2big(), RFLOAT_VALUE, and big_div_struct::yn.
Referenced by fix_equal(), flo_eq(), and rb_big_eq().
int rb_integer_pack | ( | VALUE | val, |
void * | words, | ||
size_t | numwords, | ||
size_t | wordsize, | ||
size_t | nails, | ||
int | flags | ||
) |
Definition at line 3531 of file bignum.c.
References bary_pack(), BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, BIGNUM_LEN, BIGNUM_POSITIVE_P, FIX2LONG, FIXNUM_P, numberof, RB_GC_GUARD, and rb_to_int().
Referenced by big2str_base_poweroftwo(), big_shift2(), integer_to_bnptr(), limited_big_rand(), pack_pack(), rand_init(), random_load(), random_ulong_limited_big(), rb_big_pack(), rb_hash(), rb_str_format(), and w2v().
VALUE rb_integer_unpack | ( | const void * | words, |
size_t | numwords, | ||
size_t | wordsize, | ||
size_t | nails, | ||
int | flags | ||
) |
Definition at line 3617 of file bignum.c.
References bary_unpack_internal(), bary_zero_p(), BDIGIT, BDIGIT_DBL, BDIGIT_DBL_SIGNED, BDIGIT_MSB, BDIGITS, big_extend_carry(), bignew, bignorm(), BIGNUM_LEN, BIGNUM_SET_SIGN, bigtrunc(), 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, integer_unpack_num_bdigits(), LONG2FIX, LONG_MAX, MEMCPY, NEGFIXABLE, numberof, POSFIXABLE, Qfalse, rb_eArgError, rb_raise(), val, and validate_integer_pack_format().
Referenced by ibf_load_object_bignum(), limited_big_rand(), make_seed_value(), mt_state(), pack_unpack_internal(), r_object0(), random_ulong_limited_big(), rb_big_bit_length(), and rb_big_unpack().
Definition at line 4302 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, bignew, bignorm(), BIGNUM_SET_LEN, BIGNUM_SET_NEGATIVE_SIGN, BITSPERDIG, FIXABLE, invalid_integer(), invalid_radix(), len, LONG2FIX, maxpow_in_bdigit_dbl(), neg, POSFIXABLE, RB_GC_GUARD, rb_must_asciicompat(), roomof, RSTRING_LEN, str2big_karatsuba(), str2big_scan_digits(), StringValuePtr, and valid_radix_p().
Definition at line 4260 of file bignum.c.
References bignorm(), invalid_integer(), invalid_radix(), len, maxpow_in_bdigit_dbl(), RB_GC_GUARD, rb_must_asciicompat(), roomof, RSTRING_LEN, str2big_normal(), str2big_scan_digits(), StringValuePtr, and valid_radix_p().
Definition at line 4224 of file bignum.c.
References bignorm(), bit_length, invalid_integer(), invalid_radix(), len, POW2_P, RB_GC_GUARD, rb_must_asciicompat(), RSTRING_LEN, str2big_poweroftwo(), str2big_scan_digits(), StringValueCStr, and valid_radix_p().
Definition at line 4494 of file bignum.c.
References rb_str_to_inum().
Definition at line 4205 of file bignum.c.
References INT2FIX, invalid_integer(), len, NIL_P, NULL, rb_cstr_parse_inum(), rb_must_asciicompat(), RSTRING_GETMEM, and StringValue.
Referenced by fun1(), obj2int(), obj2subsecx(), obj2vint(), rb_convert_to_integer(), rb_str2inum(), rb_str_format(), rb_str_hex(), rb_str_oct(), rb_str_to_i(), str_upto_each(), and usec2subsecx().
Definition at line 3142 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, bignew, BIGNUM_SET_LEN, and SIZEOF_VALUE.
Referenced by bigdivrem(), rb_cstr_parse_inum(), rb_int2big(), rb_uint2inum(), rb_uint2num_inline(), and rb_ulong2num_inline().
Definition at line 3185 of file bignum.c.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
Referenced by do_checksum(), rb_gzfile_crc(), rb_gzfile_total_in(), rb_gzfile_total_out(), rb_zlib_crc_table(), rb_zstream_adler(), rb_zstream_avail_out(), rb_zstream_total_in(), rb_zstream_total_out(), and zstream_run().
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_bdigit | , |
SIZEOF_BDIGIT<= | sizeofBDIGIT | ||
) |
STATIC_ASSERT | ( | sizeof_bdigit_and_dbl | , |
SIZEOF_BDIGIT *2<= | SIZEOF_BDIGIT_DBL | ||
) |
STATIC_ASSERT | ( | bdigit_signedness | ) |
STATIC_ASSERT | ( | bdigit_dbl_signedness | ) |
STATIC_ASSERT | ( | bdigit_dbl_signed_signedness | , |
0 | , | ||
(BDIGIT_DBL_SIGNED) - | 1 | ||
) |
STATIC_ASSERT | ( | rbignum_embed_len_max | , |
BIGNUM_EMBED_LEN_MAX<= | BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT | ||
) |
STATIC_ASSERT | ( | sizeof_long_and_sizeof_bdigit | , |
SIZEOF_BDIGIT % | SIZEOF_LONG = =0 |
||
) |
|
static |
Definition at line 3851 of file bignum.c.
References ALLOCV_END, ALLOCV_N, assert, bary_add(), bary_mul(), BARY_TRUNC, BDIGIT, BDIGIT_DBL, BDIGITS, BDIGITS_ZERO, BIGDN, BIGLO, bignew, BIGNUM_LEN, buf, CHAR_BIT, conv_digit, count, MEMCPY, NULL, power_cache_get_power(), SIZEOF_BDIGIT, big_div_struct::zds, and big_div_struct::zn.
Referenced by rb_cstr_parse_inum(), and rb_str2big_karatsuba().
|
static |
Definition at line 3807 of file bignum.c.
References assert, BDIGIT, BDIGIT_DBL, BDIGITS, BDIGITS_ZERO, BIGDN, BIGLO, bignew, conv_digit, and big_div_struct::zds.
Referenced by rb_cstr_parse_inum(), and rb_str2big_normal().
|
static |
Definition at line 3766 of file bignum.c.
References assert, BDIGIT, BDIGIT_DBL, BDIGITS, BIGDN, BIGLO, bignew, BITSPERDIG, conv_digit, dp, and roomof.
Referenced by rb_cstr_parse_inum(), and rb_str2big_poweroftwo().
|
static |
Definition at line 3712 of file bignum.c.
References bad, conv_digit, FALSE, ISSPACE, len, and TRUE.
Referenced by rb_cstr_parse_inum(), rb_str2big_karatsuba(), rb_str2big_normal(), and rb_str2big_poweroftwo().
|
static |
Definition at line 3060 of file bignum.c.
References BIGNUM_SET_SIGN, and get2comp().
Referenced by big_shift3(), bigand_int(), bigor_int(), bigxor_int(), rb_big_and(), rb_big_or(), and rb_big_xor().
|
inlinestatic |
Definition at line 3694 of file bignum.c.
Referenced by big2str_generic(), rb_big2str1(), rb_cstr_parse_inum(), rb_str2big_karatsuba(), rb_str2big_normal(), and rb_str2big_poweroftwo().
|
static |
Definition at line 490 of file bignum.c.
References CHAR_BIT, INTEGER_PACK_BYTEORDER_MASK, INTEGER_PACK_LSBYTE_FIRST, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_MSBYTE_FIRST, INTEGER_PACK_MSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, INTEGER_PACK_WORDORDER_MASK, PRI_SIZE_PREFIX, rb_eArgError, rb_raise(), SIZE_MAX, and SSIZE_MAX.
Referenced by bary_pack(), bary_unpack(), and rb_integer_unpack().
|
static |
Definition at line 145 of file bignum.c.
Referenced by bary_mul_karatsuba().
|
static |
Definition at line 144 of file bignum.c.
Referenced by bary_mul(), and bary_mul_toom3().
|
static |
|
static |
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz" |
Definition at line 37 of file bignum.c.
Referenced by big2str_2bdigits(), big2str_base_poweroftwo(), rb_fix2str(), rb_str_format(), and vm_living_thread_num().