Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Internal header for Bignums. More...
#include "ruby/internal/config.h"
#include <stddef.h>
#include "ruby/internal/stdbool.h"
#include "ruby/ruby.h"
Go to the source code of this file.
Data Structures | |
struct | RBignum |
Macros | |
#define | BDIGIT unsigned int |
#define | SIZEOF_BDIGIT SIZEOF_INT |
#define | BDIGIT_DBL unsigned LONG_LONG |
#define | BDIGIT_DBL_SIGNED LONG_LONG |
#define | PRI_BDIGIT_PREFIX "" |
#define | PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX |
#define | SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT |
#define | PRIdBDIGIT PRI_BDIGIT_PREFIX"d" |
#define | PRIiBDIGIT PRI_BDIGIT_PREFIX"i" |
#define | PRIoBDIGIT PRI_BDIGIT_PREFIX"o" |
#define | PRIuBDIGIT PRI_BDIGIT_PREFIX"u" |
#define | PRIxBDIGIT PRI_BDIGIT_PREFIX"x" |
#define | PRIXBDIGIT PRI_BDIGIT_PREFIX"X" |
#define | PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" |
#define | PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" |
#define | PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" |
#define | PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" |
#define | PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" |
#define | PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" |
#define | RBIGNUM(obj) ((struct RBignum *)(obj)) |
#define | BIGNUM_SIGN_BIT FL_USER1 |
#define | BIGNUM_EMBED_FLAG ((VALUE)FL_USER2) |
#define | BIGNUM_EMBED_LEN_NUMBITS 3 |
#define | BIGNUM_EMBED_LEN_MASK (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT) |
#define | BIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */ |
#define | BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1) |
Enumerations | |
enum | rb_int_parse_flags { RB_INT_PARSE_SIGN = 0x01 , RB_INT_PARSE_UNDERSCORE = 0x02 , RB_INT_PARSE_PREFIX = 0x04 , RB_INT_PARSE_ALL = 0x07 , RB_INT_PARSE_DEFAULT = 0x07 } |
Variables | |
const char | ruby_digitmap [] |
Internal header for Bignums.
Definition in file bignum.h.
#define BIGNUM_EMBED_LEN_MASK (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT) |
#define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1) |
#define BIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */ |
#define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT |
enum rb_int_parse_flags |
Definition at line 5004 of file bignum.c.
References big2str_struct::base.
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 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 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 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 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 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 6116 of file bignum.c.
References FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_int2big(), rb_intern(), and rb_num_coerce_bin().
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().
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().
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().
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 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().
|
extern |
Definition at line 48 of file bignum.c.
Referenced by rb_fix2str(), and rb_str_format().