Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
rbignum.h
Go to the documentation of this file.
1#ifndef RBIMPL_RBIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_RBIGNUM_H
24#include "ruby/internal/value.h"
27
28#define RBIGNUM_SIGN rb_big_sign
29
31#define RBIGNUM_POSITIVE_P RBIGNUM_POSITIVE_P
32#define RBIGNUM_NEGATIVE_P RBIGNUM_NEGATIVE_P
38
39static inline bool
40RBIGNUM_POSITIVE_P(VALUE b) {
41 RBIMPL_ASSERT_TYPE(b, RUBY_T_BIGNUM);
42 return RBIGNUM_SIGN(b);
43}
44
45static inline bool
46RBIGNUM_NEGATIVE_P(VALUE b) {
47 RBIMPL_ASSERT_TYPE(b, RUBY_T_BIGNUM);
48 return ! RBIGNUM_POSITIVE_P(b);
49}
50
51#endif /* RBIMPL_RBIGNUM_H */
Tewaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
big_t * num
Definition: enough.c:232
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define RBIGNUM_SIGN
Definition: rbignum.h:28
int rb_big_sign(VALUE num)
Definition: bignum.c:6769
C99 shim for <stdbool.h>
Defines VALUE and ID.
unsigned long VALUE
Definition: value.h:38
Defines enum ruby_value_type.
@ RUBY_T_BIGNUM
Definition: value_type.h:122