Ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498)
rbignum.h
Go to the documentation of this file.
1#ifndef RBIMPL_RBIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_RBIGNUM_H
25#include "ruby/internal/value.h"
28
29#define RBIGNUM_SIGN rb_big_sign
32#define RBIGNUM_POSITIVE_P RBIGNUM_POSITIVE_P
33#define RBIGNUM_NEGATIVE_P RBIGNUM_NEGATIVE_P
51int rb_big_sign(VALUE num);
53
60static inline bool
62{
63 RBIMPL_ASSERT_TYPE(b, RUBY_T_BIGNUM);
64 return RBIGNUM_SIGN(b);
65}
66
73static inline bool
75{
76 RBIMPL_ASSERT_TYPE(b, RUBY_T_BIGNUM);
77 return ! RBIGNUM_POSITIVE_P(b);
78}
79
80#endif /* RBIMPL_RBIGNUM_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:106
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:97
#define RBIGNUM_SIGN
Just another name of rb_big_sign.
Definition: rbignum.h:29
int rb_big_sign(VALUE num)
The "sign" of a bignum.
Definition: bignum.c:6769
static bool RBIGNUM_NEGATIVE_P(VALUE b)
Checks if the bignum is negative.
Definition: rbignum.h:74
static bool RBIGNUM_POSITIVE_P(VALUE b)
Checks if the bignum is positive.
Definition: rbignum.h:61
C99 shim for <stdbool.h>
Defines VALUE and ID.
Defines enum ruby_value_type.
@ RUBY_T_BIGNUM
Definition: value_type.h:124