Modules | |
| Bignum | |
| Numeric | |
C Data to Fixnum or Bignum Coversion Routines | |
| #define | INT2FIX(i) ((VALUE)(((long)(i))<<1 | FIXNUM_FLAG)) |
| #define | LONG2FIX(i) INT2FIX(i) |
| #define | rb_fix_new(v) INT2FIX(v) |
| #define | INT2NUM(v) rb_int2inum(v) |
| #define | LONG2NUM(v) INT2NUM(v) |
| #define | rb_int_new(v) rb_int2inum(v) |
| #define | UINT2NUM(v) rb_uint2inum(v) |
| #define | ULONG2NUM(v) UINT2NUM(v) |
| #define | rb_uint_new(v) rb_uint2inum(v) |
| #define | LL2NUM(v) rb_ll2inum(v) |
| #define | ULL2NUM(v) rb_ull2inum(v) |
| #define | OFFT2NUM(v) LL2NUM(v) |
| #define | FIX2LONG(x) RSHIFT((long)x,1) |
| #define | FIX2ULONG(x) (((unsigned long)(x))>>1) |
| #define | FIXNUM_P(f) (((long)(f))&FIXNUM_FLAG) |
| #define | POSFIXABLE(f) ((f) <= FIXNUM_MAX) |
| #define | NEGFIXABLE(f) ((f) >= FIXNUM_MIN) |
| #define | FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f)) |
| VALUE | rb_int2inum (long) |
| VALUE | rb_uint2inum (unsigned long) |
| VALUE | rb_ll2inum (LONG_LONG) |
| VALUE | rb_ull2inum (unsigned LONG_LONG) |
Fixnum or Bignum to C Data Coversion Routines | |
| #define | NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x)) |
| #define | NUM2ULONG(x) rb_num2ulong((VALUE)x) |
| #define | NUM2INT(x) ((int)NUM2LONG(x)) |
| #define | NUM2UINT(x) ((unsigned int)NUM2ULONG(x)) |
| #define | FIX2INT(x) ((int)FIX2LONG(x)) |
| #define | FIX2UINT(x) ((unsigned int)FIX2ULONG(x)) |
| #define | NUM2LL(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2ll((VALUE)x)) |
| #define | NUM2OFFT(x) ((off_t)NUM2LL(x)) |
| long | rb_num2long (VALUE) |
| unsigned long | rb_num2ulong (VALUE) |
| LONG_LONG | rb_num2ll (VALUE) |
| unsigned LONG_LONG | rb_num2ull (VALUE) |
Double Conversion Routines | |
| #define | NUM2DBL(x) rb_num2dbl((VALUE)(x)) |
| double | rb_num2dbl (VALUE) |
|
|
Definition at line 284 of file ruby.h. Referenced by fix_to_s(), marshal_dump(), match_aref(), proc_setgroups(), proc_setmaxgroups(), r_byte(), rb_cmpint(), rb_f_kill(), rb_fix2int(), rb_io_s_popen(), rb_io_s_sysopen(), rb_open_file(), rb_reg_initialize_m(), rb_str_aset(), rb_str_concat(), rb_str_include(), rb_str_index_m(), rb_str_rindex_m(), run_final(), trap(), and w_object(). |
|
|
|
Definition at line 285 of file ruby.h. Referenced by fix_id2name(), and fix_to_sym(). |
|
|
Definition at line 150 of file ruby.h. Referenced by rand_init(). |
|
|
Definition at line 154 of file ruby.h. Referenced by flo_ceil(), flo_floor(), flo_round(), flo_truncate(), rb_int2inum(), rb_ll2inum(), rb_num2fix(), and rb_quad_unpack(). |
|
|
|
|
|
|
|
|
|
Definition at line 129 of file ruby.h. Referenced by fix_abs(), fix_and(), fix_div(), fix_divmod(), fix_lshift(), fix_mod(), fix_or(), fix_rev(), fix_uminus(), fix_xor(), int_succ(), make_struct(), pack_unpack(), r_bytes0(), range_each(), range_step(), rb_ary_each_index(), rb_ary_fill(), rb_ary_index(), rb_ary_initialize(), rb_ary_length(), rb_ary_nitems(), rb_ary_rindex(), rb_f_rand(), rb_obj_id(), rb_require_safe(), rb_str_cmp_m(), rb_str_index_m(), rb_str_length(), rb_str_rindex_m(), struct_entry(), time_to_a(), time_to_i(), time_usec(), and time_year(). |
|
|
Definition at line 153 of file ruby.h. Referenced by bignorm(). |
|
|
Definition at line 304 of file ruby.h. Referenced by num_step(), and time_add(). |
|
|
|
Definition at line 291 of file ruby.h. Referenced by rb_num2ll(). |
|
|
|
Definition at line 295 of file ruby.h. Referenced by dir_seek(), rb_file_s_truncate(), rb_file_truncate(), rb_io_seek(), rb_io_set_pos(), and rb_io_sysseek(). |
|
|
Definition at line 283 of file ruby.h. Referenced by proc_wait(). |
|
|
Definition at line 271 of file ruby.h. Referenced by id2ref(), rb_io_ctl(), and rb_stat_inspect(). |
|
|
Definition at line 144 of file ruby.h. Referenced by rb_file_s_size(), rb_io_set_pos(), rb_io_sysseek(), rb_io_tell(), rb_stat_s(), rb_stat_size(), and test_s(). |
|
|
Definition at line 152 of file ruby.h. Referenced by bignorm(), dbl2big(), rb_cstr_to_inum(), rb_quad_unpack(), rb_uint2inum(), and rb_ull2inum(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 132 of file ruby.h. Referenced by pack_unpack(), rb_stat_gid(), rb_stat_mode(), rb_stat_nlink(), and rb_stat_uid(). |
|
|
Definition at line 140 of file ruby.h. Referenced by rb_stat_ino(). |
|
|
Definition at line 133 of file ruby.h. Referenced by pack_unpack(), rb_stat_blksize(), rb_stat_blocks(), rb_stat_dev_major(), rb_stat_dev_minor(), rb_stat_ino(), rb_stat_rdev(), rb_stat_rdev_major(), and rb_stat_rdev_minor(). |
|
|
Definition at line 181 of file bignum.c. References FIXABLE, LONG2FIX, and rb_int2big(). Referenced by dir_tell(), and rb_str_sum(). |
|
|
Definition at line 590 of file bignum.c. References FIXABLE, LONG2FIX, and rb_ll2big(). |
|
|
Definition at line 2395 of file object.c. References rb_eTypeError, rb_Float(), rb_raise(), RFLOAT, T_FLOAT, T_NIL, T_STRING, TYPE, and VALUE. Referenced by rb_thread_join_m(). |
|
|
Definition at line 1656 of file numeric.c. References FIX2LONG, FIXNUM_P, LLONG_MAX, LLONG_MIN, NIL_P, NUM2LL, Qnil, rb_big2ll(), rb_eRangeError, rb_eTypeError, rb_raise(), rb_to_int(), RFLOAT, strchr(), T_BIGNUM, T_FALSE, T_FLOAT, T_STRING, T_TRUE, TYPE, and VALUE. Referenced by rb_num2ull(). |
|
|
Definition at line 1505 of file numeric.c. References FIX2LONG, FIXNUM_P, LONG_MIN, NIL_P, NUM2LONG, rb_big2long(), rb_eRangeError, rb_eTypeError, rb_raise(), rb_to_int(), RFLOAT, strchr(), T_BIGNUM, T_FLOAT, TYPE, and VALUE. Referenced by rb_num2fix(), rb_num2int(), and rb_num2ulong(). |
|
|
Definition at line 1699 of file numeric.c. References rb_big2ull(), rb_num2ll(), T_BIGNUM, TYPE, and VALUE. |
|
|
Definition at line 1539 of file numeric.c. References rb_big2ulong(), rb_num2long(), T_BIGNUM, TYPE, and VALUE. |
|
|
Definition at line 173 of file bignum.c. References LONG2FIX, POSFIXABLE, and rb_uint2big(). |
|
|
Definition at line 582 of file bignum.c. References LONG2FIX, POSFIXABLE, and rb_ull2big(). |
1.3.5