Ruby 3.4.1p0 (2024-12-25 revision 48d4efcb85000e1ebae42004e963b5d0cedddcf2)
|
Handling of integers formerly known as Fixnums. More...
#include "ruby/backward/2/limits.h"
Go to the source code of this file.
Macros | |
#define | FIXABLE RB_FIXABLE |
Old name of RB_FIXABLE. | |
#define | FIXNUM_MAX RUBY_FIXNUM_MAX |
Old name of RUBY_FIXNUM_MAX. | |
#define | FIXNUM_MIN RUBY_FIXNUM_MIN |
Old name of RUBY_FIXNUM_MIN. | |
#define | NEGFIXABLE RB_NEGFIXABLE |
Old name of RB_NEGFIXABLE. | |
#define | POSFIXABLE RB_POSFIXABLE |
Old name of RB_POSFIXABLE. | |
#define | RB_POSFIXABLE(_) |
Checks if the passed value is in range of fixnum, assuming it is a positive number. | |
#define | RB_NEGFIXABLE(_) |
Checks if the passed value is in range of fixnum, assuming it is a negative number. | |
#define | RB_FIXABLE(_) |
Checks if the passed value is in range of fixnum. | |
#define | RUBY_FIXNUM_MAX (LONG_MAX / 2) |
Maximum possible value that a fixnum can represent. | |
#define | RUBY_FIXNUM_MIN (LONG_MIN / 2) |
Minimum possible value that a fixnum can represent. | |
Handling of integers formerly known as Fixnums.
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 fixnum.h.
#define RB_FIXABLE | ( | _ | ) |
Checks if the passed value is in range of fixnum.
Definition at line 52 of file fixnum.h.
Referenced by RB_INT2FIX(), rb_int2num_inline(), rb_long2num_inline(), and RB_ST2FIX().
#define RB_NEGFIXABLE | ( | _ | ) |
Checks if the passed value is in range of fixnum, assuming it is a negative number.
This is an implementation of RB_FIXABLE. Rarely used stand alone.
#define RB_POSFIXABLE | ( | _ | ) |
Checks if the passed value is in range of fixnum, assuming it is a positive number.
Can sometimes be useful for C's unsigned integer types.
Definition at line 43 of file fixnum.h.
Referenced by rb_uint2num_inline(), and rb_ulong2num_inline().
#define RUBY_FIXNUM_MAX (LONG_MAX / 2) |
Maximum possible value that a fixnum can represent.
Definition at line 55 of file fixnum.h.
Referenced by RB_ST2FIX().
#define RUBY_FIXNUM_MIN (LONG_MIN / 2) |
Minimum possible value that a fixnum can represent.
Definition at line 58 of file fixnum.h.
Referenced by RB_ST2FIX().