Ruby  3.4.0dev (2024-11-05 revision e440268d51fe02b303e3817a7a733a0dac1c5091)
Macros | Functions
rbignum.h File Reference

(e440268d51fe02b303e3817a7a733a0dac1c5091)

Routines to manipulate struct RBignum. More...

#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
#include "ruby/internal/value_type.h"
#include "ruby/internal/stdbool.h"
Include dependency graph for rbignum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RBIGNUM_SIGN   rb_big_sign
 Just another name of rb_big_sign. More...
 

Functions

int rb_big_sign (VALUE num)
 The "sign" of a bignum. More...
 
static bool RBIGNUM_POSITIVE_P (VALUE b)
 Checks if the bignum is positive. More...
 
static bool RBIGNUM_NEGATIVE_P (VALUE b)
 Checks if the bignum is negative. More...
 

Detailed Description

Routines to manipulate struct RBignum.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
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.
The struct RBignum itself is opaque.

Definition in file rbignum.h.

Macro Definition Documentation

◆ RBIGNUM_SIGN

#define RBIGNUM_SIGN   rb_big_sign

Just another name of rb_big_sign.

Definition at line 29 of file rbignum.h.

Function Documentation

◆ rb_big_sign()

int rb_big_sign ( VALUE  num)

The "sign" of a bignum.

Parameters
[in]numAn object of RBignum.
Return values
1It is greater than or equal to zero.
0It is less than zero.

Definition at line 6801 of file bignum.c.

◆ RBIGNUM_NEGATIVE_P()

static bool RBIGNUM_NEGATIVE_P ( VALUE  b)
inlinestatic

Checks if the bignum is negative.

Parameters
[in]bAn object of RBignum.
Return values
trueb is less than zero.
falseOtherwise.

Definition at line 74 of file rbignum.h.

◆ RBIGNUM_POSITIVE_P()

static bool RBIGNUM_POSITIVE_P ( VALUE  b)
inlinestatic

Checks if the bignum is positive.

Parameters
[in]bAn object of RBignum.
Return values
falseb is less than zero.
trueOtherwise.

Definition at line 61 of file rbignum.h.

Referenced by RBIGNUM_NEGATIVE_P().