Ruby: include/ruby/internal/arithmetic/fixnum.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros
fixnum.h File Reference

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
#define | FIXNUM_MAX RUBY_FIXNUM_MAX
#define | FIXNUM_MIN RUBY_FIXNUM_MIN
#define | NEGFIXABLE RB_NEGFIXABLE
#define | POSFIXABLE RB_POSFIXABLE
#define | RB_POSFIXABLE(_) ((_) < RUBY_FIXNUM_MAX + 1)
#define | RB_NEGFIXABLE(_) ((_) >= RUBY_FIXNUM_MIN)
#define | RB_FIXABLE(_) (RB_POSFIXABLE(_) && RB_NEGFIXABLE(_))
#define | RUBY_FIXNUM_MAX (LONG_MAX / 2)
#define | RUBY_FIXNUM_MIN (LONG_MIN / 2)

## Detailed Description

Handling of integers formerly known as Fixnums.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Warning
  Symbols prefixed with either `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.

Note
  To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance `__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.

## Macro Definition Documentation

## ◆ FIXABLE

#define FIXABLE RB_FIXABLE

Definition at line 25 of file fixnum.h.

## ◆ FIXNUM_MAX

#define FIXNUM_MAX RUBY_FIXNUM_MAX

Definition at line 26 of file fixnum.h.

## ◆ FIXNUM_MIN

#define FIXNUM_MIN RUBY_FIXNUM_MIN

Definition at line 27 of file fixnum.h.

## ◆ NEGFIXABLE

#define NEGFIXABLE RB_NEGFIXABLE

Definition at line 28 of file fixnum.h.

## ◆ POSFIXABLE

#define POSFIXABLE RB_POSFIXABLE

Definition at line 29 of file fixnum.h.

## ◆ RB_FIXABLE

#define RB_FIXABLE | ( |  | _ | ) | (RB_POSFIXABLE(_) && RB_NEGFIXABLE(_))

Definition at line 40 of file fixnum.h.

## ◆ RB_NEGFIXABLE

#define RB_NEGFIXABLE | ( |  | _ | ) | ((_) >= RUBY_FIXNUM_MIN)

Definition at line 39 of file fixnum.h.

## ◆ RB_POSFIXABLE

#define RB_POSFIXABLE | ( |  | _ | ) | ((_) < RUBY_FIXNUM_MAX + 1)

Definition at line 38 of file fixnum.h.

## ◆ RUBY_FIXNUM_MAX

#define RUBY_FIXNUM_MAX (LONG_MAX / 2)

Definition at line 41 of file fixnum.h.

## ◆ RUBY_FIXNUM_MIN

#define RUBY_FIXNUM_MIN (LONG_MIN / 2)

Definition at line 42 of file fixnum.h.