|
Ruby 4.1.0dev (2026-10-29 revision d5d40d27490b11b73a68f43e918199b6d386101a)
|
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 |
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.
RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file len_t.h.
| #define RB_FIX2LEN rb_fix2len |
| #define RB_FIX2ULEN rb_fix2ulen |
| #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_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. |
rb_len_t. Definition at line 179 of file len_t.h.
Referenced by rb_fix2long(), and rb_fix2ulen().
|
inlinestatic |
Converts a Fixnum into rb_ulen_t.
| [in] | x | Some Fixnum. |
rb_ulen_t. rb_ulen_t. Definition at line 200 of file len_t.h.
Referenced by rb_fix2ulong().
|
inlinestatic |
|
inlinestatic |
Converts a C's long into an instance of rb_cInteger.
| [in] | i | Arbitrary long value. |
Definition at line 98 of file len_t.h.
Referenced by RB_CHR2FIX(), 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 73 of file len_t.h.
Referenced by RB_INT2FIX().
|
inlinestatic |