Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
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. More... | |
#define | FIXNUM_MAX RUBY_FIXNUM_MAX |
Old name of RUBY_FIXNUM_MAX. More... | |
#define | FIXNUM_MIN RUBY_FIXNUM_MIN |
Old name of RUBY_FIXNUM_MIN. More... | |
#define | NEGFIXABLE RB_NEGFIXABLE |
Old name of RB_NEGFIXABLE. More... | |
#define | POSFIXABLE RB_POSFIXABLE |
Old name of RB_POSFIXABLE. More... | |
#define | RB_POSFIXABLE(_) ((_) < RUBY_FIXNUM_MAX + 1) |
Checks if the passed value is in range of fixnum, assuming it is a positive number. More... | |
#define | RB_NEGFIXABLE(_) ((_) >= RUBY_FIXNUM_MIN) |
Checks if the passed value is in range of fixnum, assuming it is a negative number. More... | |
#define | RB_FIXABLE(_) (RB_POSFIXABLE(_) && RB_NEGFIXABLE(_)) |
Checks if the passed value is in range of fixnum. More... | |
#define | RUBY_FIXNUM_MAX (LONG_MAX / 2) |
Maximum possible value that a fixnum can represent. More... | |
#define | RUBY_FIXNUM_MIN (LONG_MIN / 2) |
Minimum possible value that a fixnum can represent. More... | |
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 | ( | _ | ) | (RB_POSFIXABLE(_) && RB_NEGFIXABLE(_)) |
#define RB_NEGFIXABLE | ( | _ | ) | ((_) >= RUBY_FIXNUM_MIN) |
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 | ( | _ | ) | ((_) < RUBY_FIXNUM_MAX + 1) |
#define RUBY_FIXNUM_MAX (LONG_MAX / 2) |