|
Ruby 4.1.0dev (2026-11-19 revision 2e6b197f6849401b2c25894b5b8ac39ac3c2558e)
|
Arithmetic conversion between rb_len_t and Ruby's. More...
#include "ruby/internal/config.h"#include "ruby/internal/arithmetic/long.h"#include "ruby/internal/arithmetic/long_long.h"#include "ruby/internal/assume.h"#include "ruby/internal/cast.h"#include "ruby/internal/value.h"

Go to the source code of this file.
Macros | |
| #define | FIX2LEN RB_FIX2LEN |
| Old name of RB_FIX2LEN. | |
| #define | FIX2ULEN RB_FIX2ULEN |
| Old name of RB_FIX2ULEN. | |
| #define | LEN2FIX RB_LEN2FIX |
| Old name of RB_LEN2FIX. | |
| #define | LEN2NUM RB_LEN2NUM |
| Old name of RB_LEN2NUM. | |
| #define | NUM2LEN RB_NUM2LEN |
| Old name of RB_NUM2LEN. | |
| #define | ULEN2NUM RB_ULEN2NUM |
| Old name of RB_ULEN2NUM. | |
| #define | NUM2ULEN RB_NUM2ULEN |
| Old name of RB_NUM2ULEN. | |
| #define | rb_len2int rb_len2int_inline |
| Just another name of rb_len2int_inline. | |
| #define | rb_len2long rb_len2long_inline |
| Just another name of rb_len2long_inline. | |
| #define | RB_LEN2NUM RB_LONG2NUM |
| Converts a rb_len_t into an instance of rb_cInteger. | |
| #define | RB_NUM2LEN RB_NUM2LONG |
| Converts an instance of rb_cNumeric into rb_len_t. | |
| #define | RB_ULEN2NUM RB_ULONG2NUM |
| Converts a rb_ulen_t into an instance of rb_cInteger. | |
| #define | RB_NUM2ULEN RB_NUM2ULONG |
| Converts an instance of rb_cNumeric into rb_len_t. | |
| #define | RB_FIX2LEN rb_fix2len |
| #define | RB_FIX2ULEN rb_fix2ulen |
| #define | RB_LEN2FIX rb_len2fix |
Functions | |
| static VALUE | rb_len2fix (rb_len_t i) |
| Converts a rb_len_t into an instance of rb_cInteger. | |
| static VALUE | RB_INT2FIX (long i) |
| Converts a C's long into an instance of rb_cInteger. | |
| static rb_len_t | rb_fix2len (VALUE x) |
| Converts a Fixnum into rb_len_t. | |
| static rb_ulen_t | rb_fix2ulen (VALUE x) |
| Converts a Fixnum into rb_ulen_t. | |
| static int | rb_len2int_inline (rb_len_t n) |
| Checks if int can hold the given integer. | |
| static long | rb_len2long_inline (rb_len_t n) |
| Checks if long can hold the given integer. | |
| static long | rb_fix2long (VALUE x) |
| Converts a Fixnum into C's long. | |
| static unsigned long | rb_fix2ulong (VALUE x) |
| Converts a Fixnum into C's unsigned long. | |
Arithmetic conversion between rb_len_t and Ruby's.
Definition in file len_t.h.
| #define RB_FIX2LEN rb_fix2len |
| #define RB_FIX2ULEN rb_fix2ulen |
| #define RB_LEN2FIX rb_len2fix |
| #define rb_len2int rb_len2int_inline |
Just another name of rb_len2int_inline.
Definition at line 37 of file len_t.h.
Referenced by RARRAY_LENINT(), rb_profile_frame_full_label(), rb_struct_new(), and RSTRING_LENINT().
| #define rb_len2long rb_len2long_inline |
Just another name of rb_len2long_inline.
Definition at line 38 of file len_t.h.
Referenced by rb_fix2long().
| #define RB_LEN2NUM RB_LONG2NUM |
Converts a rb_len_t into an instance of rb_cInteger.
| #define RB_NUM2LEN RB_NUM2LONG |
Converts an instance of rb_cNumeric into rb_len_t.
Definition at line 50 of file len_t.h.
Referenced by RSTRUCT_LEN().
| #define RB_NUM2ULEN RB_NUM2ULONG |
Converts an instance of rb_cNumeric into rb_len_t.
| #define RB_ULEN2NUM RB_ULONG2NUM |
Converts a rb_ulen_t into an instance of rb_cInteger.
Converts a Fixnum into rb_len_t.
| [in] | x | Some Fixnum. |
Definition at line 180 of file len_t.h.
Referenced by rb_fix2len(), rb_fix2long(), and rb_fix2ulen().
|
inlinestatic |
Converts a Fixnum into rb_ulen_t.
| [in] | x | Some Fixnum. |
Definition at line 201 of file len_t.h.
Referenced by rb_fix2ulen(), and rb_fix2ulong().
|
inlinestatic |
|
inlinestatic |
Converts a C's long into an instance of rb_cInteger.
| [in] | i | Arbitrary long value. |
Definition at line 99 of file len_t.h.
Referenced by RB_CHR2FIX(), RB_INT2FIX(), and rb_int2num_inline().
Converts a rb_len_t into an instance of rb_cInteger.
| [in] | i | FIXABLE rb_len_t value. |
Definition at line 74 of file len_t.h.
Referenced by RB_INT2FIX(), and rb_len2fix().
|
inlinestatic |