Ruby: ext/bigdecimal/bigdecimal.h Source File

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

bigdecimal.h
Go to the documentation of this file.
1/*
2 *
3 * Ruby BigDecimal(Variable decimal precision) extension library.
4 *
5 * Copyright(C) 2002 by Shigeo Kobayashi(shigeo@tinyforest.gr.jp)
6 *
7 */
8
9#ifndef RUBY_BIG_DECIMAL_H
10#define RUBY_BIG_DECIMAL_H 1
11
12#define RUBY_NO_OLD_COMPATIBILITY
13
14#include "ruby/ruby.h"
15#include <float.h>
16
17#ifndef RB_UNUSED_VAR
18# ifdef __GNUC__
19# define RB_UNUSED_VAR(x) x __attribute__ ((unused))
20# else
21# define RB_UNUSED_VAR(x) x
22# endif
23#endif
24
25#ifndef UNREACHABLE
26# define UNREACHABLE /* unreachable */
27#endif
28
29#undef BDIGIT
30#undef SIZEOF_BDIGITS
31#undef BDIGIT_DBL
32#undef BDIGIT_DBL_SIGNED
33#undef PRI_BDIGIT_PREFIX
34#undef PRI_BDIGIT_DBL_PREFIX
35
36#ifdef HAVE_INT64_T
37# define BDIGIT uint32_t
38# define BDIGIT_DBL uint64_t
39# define BDIGIT_DBL_SIGNED int64_t
40# define SIZEOF_BDIGITS 4
41# define PRI_BDIGIT_PREFIX ""
42# ifdef PRI_LL_PREFIX
43# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
44# else
45# define PRI_BDIGIT_DBL_PREFIX "l"
46# endif
47#else
48# define BDIGIT uint16_t
49# define BDIGIT_DBL uint32_t
50# define BDIGIT_DBL_SIGNED int32_t
51# define SIZEOF_BDIGITS 2
52# define PRI_BDIGIT_PREFIX "h"
53# define PRI_BDIGIT_DBL_PREFIX ""
54#endif
55
56#define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
57#define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
58#define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
59#define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
60#define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
61#define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
62
63#define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
64#define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
65#define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
66#define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
67#define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
68#define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
69
70#if defined(__cplusplus)
71extern "C" {
72#if 0
73} /* satisfy cc-mode */
74#endif
75#endif
76
77#ifndef HAVE_LABS
78static inline long
79labs(long const x)
80{
81 if (x < 0) return -x;
82 return x;
83}
84#endif
85
86#ifndef HAVE_LLABS
87static inline LONG_LONG
88llabs(LONG_LONG const x)
89{
90 if (x < 0) return -x;
91 return x;
92}
93#endif
94
95#ifndef HAVE_FINITE
96static int
97finite(double)
98{
99 return !isnan(n) && !isinf(n);
100}
101#endif
102
103#ifndef isfinite
104# ifndef HAVE_ISFINITE
105# define HAVE_ISFINITE 1
106# define isfinite(x) finite(x)
107# endif
108#endif
109
110#ifndef FIX_CONST_VALUE_PTR
111# if defined(__fcc__) || defined(__fcc_version) || \
112 defined(__FCC__) || defined(__FCC_VERSION)
113/* workaround for old version of Fujitsu C Compiler (fcc) */
114# define FIX_CONST_VALUE_PTR(x) ((const VALUE *)(x))
115# else
116# define FIX_CONST_VALUE_PTR(x) (x)
117# endif
118#endif
119
120#ifndef HAVE_RB_ARRAY_CONST_PTR
121static inline const VALUE *
122rb_array_const_ptr(VALUE a)
123{
124 return FIX_CONST_VALUE_PTR((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ?
125 RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr);
126}
127#endif
128
129#ifndef RARRAY_CONST_PTR
130# define RARRAY_CONST_PTR(a) rb_array_const_ptr(a)
131#endif
132
133#ifndef RARRAY_AREF
134# define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i])
135#endif
136
137#ifndef HAVE_RB_SYM2STR
138static inline VALUE
139rb_sym2str(VALUE sym)
140{
141 return rb_id2str(SYM2ID(sym));
142}
143#endif
144
145#ifndef ST2FIX
146# undef RB_ST2FIX
147# define RB_ST2FIX(h) LONG2FIX((long)(h))
148# define ST2FIX(h) RB_ST2FIX(h)
149#endif
150
151#ifdef vabs
152# undef vabs
153#endif
154#if SIZEOF_VALUE <= SIZEOF_INT
155# define vabs abs
156#elif SIZEOF_VALUE <= SIZEOF_LONG
157# define vabs labs
158#elif SIZEOF_VALUE <= SIZEOF_LONG_LONG
159# define vabs llabs
160#endif
161
162#if !defined(HAVE_RB_CATEGORY_WARN) || !defined(HAVE_CONST_RB_WARN_CATEGORY_DEPRECATED)
163# define rb_category_warn(category, ...) rb_warn(__VA_ARGS__)
164#endif
165
166extern VALUE rb_cBigDecimal;
167
168#if 0 || SIZEOF_BDIGITS >= 16
169# define RMPD_COMPONENT_FIGURES 38
170# define RMPD_BASE ((BDIGIT)100000000000000000000000000000000000000U)
171#elif SIZEOF_BDIGITS >= 8
172# define RMPD_COMPONENT_FIGURES 19
173# define RMPD_BASE ((BDIGIT)10000000000000000000U)
174#elif SIZEOF_BDIGITS >= 4
175# define RMPD_COMPONENT_FIGURES 9
176# define RMPD_BASE ((BDIGIT)1000000000U)
177#elif SIZEOF_BDIGITS >= 2
178# define RMPD_COMPONENT_FIGURES 4
179# define RMPD_BASE ((BDIGIT)10000U)
180#else
181# define RMPD_COMPONENT_FIGURES 2
182# define RMPD_BASE ((BDIGIT)100U)
183#endif
184
185
186/*
187 * NaN & Infinity
188 */
189#define SZ_NaN "NaN"
190#define SZ_INF "Infinity"
191#define SZ_PINF "+Infinity"
192#define SZ_NINF "-Infinity"
193
194/*
195 * #define VP_EXPORT other than static to let VP_ routines
196 * be called from outside of this module.
197 */
198#define VP_EXPORT static
199
200/* Exception codes */
201#define VP_EXCEPTION_ALL ((unsigned short)0x00FF)
202#define VP_EXCEPTION_INFINITY ((unsigned short)0x0001)
203#define VP_EXCEPTION_NaN ((unsigned short)0x0002)
204#define VP_EXCEPTION_UNDERFLOW ((unsigned short)0x0004)
205#define VP_EXCEPTION_OVERFLOW ((unsigned short)0x0001) /* 0x0008) */
206#define VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0010)
207
208/* Following 2 exceptions can't controlled by user */
209#define VP_EXCEPTION_OP ((unsigned short)0x0020)
210#define VP_EXCEPTION_MEMORY ((unsigned short)0x0040)
211
212#define RMPD_EXCEPTION_MODE_DEFAULT 0U
213
214/* Computation mode */
215#define VP_ROUND_MODE ((unsigned short)0x0100)
216#define VP_ROUND_UP 1
217#define VP_ROUND_DOWN 2
218#define VP_ROUND_HALF_UP 3
219#define VP_ROUND_HALF_DOWN 4
220#define VP_ROUND_CEIL 5
221#define VP_ROUND_FLOOR 6
222#define VP_ROUND_HALF_EVEN 7
223
224#define RMPD_ROUNDING_MODE_DEFAULT VP_ROUND_HALF_UP
225
226#define VP_SIGN_NaN 0 /* NaN */
227#define VP_SIGN_POSITIVE_ZERO 1 /* Positive zero */
228#define VP_SIGN_NEGATIVE_ZERO -1 /* Negative zero */
229#define VP_SIGN_POSITIVE_FINITE 2 /* Positive finite number */
230#define VP_SIGN_NEGATIVE_FINITE -2 /* Negative finite number */
231#define VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */
232#define VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */
233
234#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
235#define FLEXIBLE_ARRAY_SIZE /* */
236#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
237#define FLEXIBLE_ARRAY_SIZE 0
238#else
239#define FLEXIBLE_ARRAY_SIZE 1
240#endif
241
242/*
243 * VP representation
244 * r = 0.xxxxxxxxx *BASE**exponent
245 */
246 typedef struct {
247 VALUE obj; /* Back pointer(VALUE) for Ruby object. */
248 size_t MaxPrec; /* Maximum precision size */
249 /* This is the actual size of frac[] */
250 /*(frac[0] to frac[MaxPrec] are available). */
251 size_t Prec; /* Current precision size. */
252 /* This indicates how much the */
253 /* array frac[] is actually used. */
254 SIGNED_VALUE exponent; /* Exponent part. */
255 short sign; /* Attributes of the value. */
256 /*
257 * ==0 : NaN
258 * 1 : Positive zero
259 * -1 : Negative zero
260 * 2 : Positive number
261 * -2 : Negative number
262 * 3 : Positive infinite number
263 * -3 : Negative infinite number
264 */
265 short flag; /* Not used in vp_routines,space for user. */
266 BDIGIT frac[FLEXIBLE_ARRAY_SIZE]; /* Array of fraction part. */
267} Real;
268
269/*
270 * ------------------
271 * EXPORTables.
272 * ------------------
273 */
274
275 VP_EXPORT Real *
276 VpNewRbClass(size_t mx, char const *str, VALUE klass);
277
278 VP_EXPORT Real *VpCreateRbObject(size_t mx,const char *str);
279
280static inline BDIGIT
281rmpd_base_value(void) { return RMPD_BASE; }
282static inline size_t
283rmpd_component_figures(void) { return RMPD_COMPONENT_FIGURES; }
284static inline size_t
285rmpd_double_figures(void) { return 1+DBL_DIG; }
286
287#define VpBaseFig() rmpd_component_figures()
288#define VpDblFig() rmpd_double_figures()
289#define VpBaseVal() rmpd_base_value()
290
291/* Zero,Inf,NaN (isinf(),isnan() used to check) */
292 VP_EXPORT double VpGetDoubleNaN(void);
293 VP_EXPORT double VpGetDoublePosInf(void);
294 VP_EXPORT double VpGetDoubleNegInf(void);
295 VP_EXPORT double VpGetDoubleNegZero(void);
296
297/* These 2 functions added at v1.1.7 */
298 VP_EXPORT size_t VpGetPrecLimit(void);
299 VP_EXPORT size_t VpSetPrecLimit(size_t n);
300
301/* Round mode */
302 VP_EXPORT int VpIsRoundMode(unsigned short n);
303 VP_EXPORT unsigned short VpGetRoundMode(void);
304 VP_EXPORT unsigned short VpSetRoundMode(unsigned short n);
305
306 VP_EXPORT int VpException(unsigned short f,const char *str,int always);
307#if 0 /* unused */
308 VP_EXPORT int VpIsNegDoubleZero(double v);
309#endif
310 VP_EXPORT size_t VpNumOfChars(Real *vp,const char *pszFmt);
311 VP_EXPORT size_t VpInit(BDIGIT BaseVal);
312 VP_EXPORT void *VpMemAlloc(size_t mb);
313 VP_EXPORT void *VpMemRealloc(void *ptr, size_t mb);
314 VP_EXPORT void VpFree(Real *pv);
315 VP_EXPORT Real *VpAlloc(size_t mx, const char *szVal, int strict_p, int exc);
316 VP_EXPORT size_t VpAsgn(Real *c, Real *a, int isw);
317 VP_EXPORT size_t VpAddSub(Real *c,Real *a,Real *b,int operation);
318 VP_EXPORT size_t VpMult(Real *c,Real *a,Real *b);
319 VP_EXPORT size_t VpDivd(Real *c,Real *r,Real *a,Real *b);
320 VP_EXPORT int VpComp(Real *a,Real *b);
321 VP_EXPORT ssize_t VpExponent10(Real *a);
322 VP_EXPORT void VpSzMantissa(Real *a,char *psz);
323 VP_EXPORT int VpToSpecialString(Real *a,char *psz,int fPlus);
324 VP_EXPORT void VpToString(Real *a, char *psz, size_t fFmt, int fPlus);
325 VP_EXPORT void VpToFString(Real *a, char *psz, size_t fFmt, int fPlus);
326 VP_EXPORT int VpCtoV(Real *a, const char *int_chr, size_t ni, const char *frac, size_t nf, const char *exp_chr, size_t ne);
327 VP_EXPORT int VpVtoD(double *d, SIGNED_VALUE *e, Real *m);
328 VP_EXPORT void VpDtoV(Real *m,double d);
329#if 0 /* unused */
330 VP_EXPORT void VpItoV(Real *m,S_INT ival);
331#endif
332 VP_EXPORT int VpSqrt(Real *y,Real *x);
333 VP_EXPORT int VpActiveRound(Real *y, Real *x, unsigned short f, ssize_t il);
334 VP_EXPORT int VpMidRound(Real *y, unsigned short f, ssize_t nf);
335 VP_EXPORT int VpLeftRound(Real *y, unsigned short f, ssize_t nf);
336 VP_EXPORT void VpFrac(Real *y, Real *x);
337 VP_EXPORT int VpPower(Real *y, Real *x, SIGNED_VALUE n);
338
339/* VP constants */
340 VP_EXPORT Real *VpOne(void);
341
342/*
343 * ------------------
344 * MACRO definitions.
345 * ------------------
346 */
347#define Abs(a) (((a)>= 0)?(a):(-(a)))
348#define Max(a, b) (((a)>(b))?(a):(b))
349#define Min(a, b) (((a)>(b))?(b):(a))
350
351#define VpMaxPrec(a) ((a)->MaxPrec)
352#define VpPrec(a) ((a)->Prec)
353#define VpGetFlag(a) ((a)->flag)
354
355/* Sign */
356
357/* VpGetSign(a) returns 1,-1 if a>0,a<0 respectively */
358#define VpGetSign(a) (((a)->sign>0)?1:(-1))
359/* Change sign of a to a>0,a<0 if s = 1,-1 respectively */
360#define VpChangeSign(a,s) {if((s)>0) (a)->sign=(short)Abs((ssize_t)(a)->sign);else (a)->sign=-(short)Abs((ssize_t)(a)->sign);}
361/* Sets sign of a to a>0,a<0 if s = 1,-1 respectively */
362#define VpSetSign(a,s) {if((s)>0) (a)->sign=(short)VP_SIGN_POSITIVE_FINITE;else (a)->sign=(short)VP_SIGN_NEGATIVE_FINITE;}
363
364/* 1 */
365#define VpSetOne(a) {(a)->Prec=(a)->exponent=(a)->frac[0]=1;(a)->sign=VP_SIGN_POSITIVE_FINITE;}
366
367/* ZEROs */
368#define VpIsPosZero(a) ((a)->sign==VP_SIGN_POSITIVE_ZERO)
369#define VpIsNegZero(a) ((a)->sign==VP_SIGN_NEGATIVE_ZERO)
370#define VpIsZero(a) (VpIsPosZero(a) || VpIsNegZero(a))
371#define VpSetPosZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_ZERO)
372#define VpSetNegZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_ZERO)
373#define VpSetZero(a,s) (void)(((s)>0)?VpSetPosZero(a):VpSetNegZero(a))
374
375/* NaN */
376#define VpIsNaN(a) ((a)->sign==VP_SIGN_NaN)
377#define VpSetNaN(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NaN)
378
379/* Infinity */
380#define VpIsPosInf(a) ((a)->sign==VP_SIGN_POSITIVE_INFINITE)
381#define VpIsNegInf(a) ((a)->sign==VP_SIGN_NEGATIVE_INFINITE)
382#define VpIsInf(a) (VpIsPosInf(a) || VpIsNegInf(a))
383#define VpIsDef(a) ( !(VpIsNaN(a)||VpIsInf(a)) )
384#define VpSetPosInf(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_INFINITE)
385#define VpSetNegInf(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_INFINITE)
386#define VpSetInf(a,s) (void)(((s)>0)?VpSetPosInf(a):VpSetNegInf(a))
387#define VpHasVal(a) (a->frac[0])
388#define VpIsOne(a) ((a->Prec==1)&&(a->frac[0]==1)&&(a->exponent==1))
389#define VpExponent(a) (a->exponent)
390#ifdef BIGDECIMAL_DEBUG
391int VpVarCheck(Real * v);
392#endif /* BIGDECIMAL_DEBUG */
393
394#if defined(__cplusplus)
395#if 0
396{ /* satisfy cc-mode */
397#endif
398} /* extern "C" { */
399#endif
400#endif /* RUBY_BIG_DECIMAL_H */
VpGetDoubleNegZero
VP_EXPORT double VpGetDoubleNegZero(void)
Definition: bigdecimal.c:3953
VpDivd
VP_EXPORT size_t VpDivd(Real *c, Real *r, Real *a, Real *b)
Definition: bigdecimal.c:5133
VpCreateRbObject
VP_EXPORT Real * VpCreateRbObject(size_t mx, const char *str)
Definition: bigdecimal.c:783
VP_EXPORT
#define VP_EXPORT
Definition: bigdecimal.h:198
VpIsRoundMode
VP_EXPORT int VpIsRoundMode(unsigned short n)
Definition: bigdecimal.c:3876
VpToString
VP_EXPORT void VpToString(Real *a, char *psz, size_t fFmt, int fPlus)
Definition: bigdecimal.c:5710
VpNewRbClass
VP_EXPORT Real * VpNewRbClass(size_t mx, char const *str, VALUE klass)
Definition: bigdecimal.c:772
VpInit
VP_EXPORT size_t VpInit(BDIGIT BaseVal)
Definition: bigdecimal.c:4141
VpGetDoubleNaN
VP_EXPORT double VpGetDoubleNaN(void)
Definition: bigdecimal.c:3935
rb_cBigDecimal
VALUE rb_cBigDecimal
Definition: bigdecimal.c:45
VpGetDoubleNegInf
VP_EXPORT double VpGetDoubleNegInf(void)
Definition: bigdecimal.c:3947
VpGetRoundMode
VP_EXPORT unsigned short VpGetRoundMode(void)
Definition: bigdecimal.c:3860
VpDtoV
VP_EXPORT void VpDtoV(Real *m, double d)
Definition: bigdecimal.c:6048
VpMult
VP_EXPORT size_t VpMult(Real *c, Real *a, Real *b)
Definition: bigdecimal.c:5004
VpFrac
VP_EXPORT void VpFrac(Real *y, Real *x)
Definition: bigdecimal.c:6561
VpExponent10
VP_EXPORT ssize_t VpExponent10(Real *a)
Definition: bigdecimal.c:5611
VpLeftRound
VP_EXPORT int VpLeftRound(Real *y, unsigned short f, ssize_t nf)
Definition: bigdecimal.c:6451
VpOne
VP_EXPORT Real * VpOne(void)
Definition: bigdecimal.c:4169
VpAddSub
VP_EXPORT size_t VpAddSub(Real *c, Real *a, Real *b, int operation)
Definition: bigdecimal.c:4549
VpGetPrecLimit
VP_EXPORT size_t VpGetPrecLimit(void)
Definition: bigdecimal.c:3825
VpSetRoundMode
VP_EXPORT unsigned short VpSetRoundMode(unsigned short n)
Definition: bigdecimal.c:3894
VpSetPrecLimit
VP_EXPORT size_t VpSetPrecLimit(size_t n)
Definition: bigdecimal.c:3841
VpSzMantissa
VP_EXPORT void VpSzMantissa(Real *a, char *psz)
Definition: bigdecimal.c:5628
VpNumOfChars
VP_EXPORT size_t VpNumOfChars(Real *vp, const char *pszFmt)
Definition: bigdecimal.c:4097
VpSqrt
VP_EXPORT int VpSqrt(Real *y, Real *x)
Definition: bigdecimal.c:6180
FLEXIBLE_ARRAY_SIZE
#define FLEXIBLE_ARRAY_SIZE
Definition: bigdecimal.h:235
VpAlloc
VP_EXPORT Real * VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
Definition: bigdecimal.c:4272
RMPD_BASE
#define RMPD_BASE
Definition: bigdecimal.h:182
BDIGIT
#define BDIGIT
Definition: bigdecimal.h:48
VpMemAlloc
VP_EXPORT void * VpMemAlloc(size_t mb)
Definition: bigdecimal.c:3736
FIX_CONST_VALUE_PTR
#define FIX_CONST_VALUE_PTR(x)
Definition: bigdecimal.h:116
VpComp
VP_EXPORT int VpComp(Real *a, Real *b)
Definition: bigdecimal.c:5386
VpActiveRound
VP_EXPORT int VpActiveRound(Real *y, Real *x, unsigned short f, ssize_t il)
Definition: bigdecimal.c:6466
VpMidRound
VP_EXPORT int VpMidRound(Real *y, unsigned short f, ssize_t nf)
Definition: bigdecimal.c:6289
VpException
VP_EXPORT int VpException(unsigned short f, const char *str, int always)
Definition: bigdecimal.c:3970
VpMemRealloc
VP_EXPORT void * VpMemRealloc(void *ptr, size_t mb)
Definition: bigdecimal.c:3750
VpPower
VP_EXPORT int VpPower(Real *y, Real *x, SIGNED_VALUE n)
Definition: bigdecimal.c:6609
VpVtoD
VP_EXPORT int VpVtoD(double *d, SIGNED_VALUE *e, Real *m)
Definition: bigdecimal.c:5984
VpToFString
VP_EXPORT void VpToFString(Real *a, char *psz, size_t fFmt, int fPlus)
Definition: bigdecimal.c:5758
RMPD_COMPONENT_FIGURES
#define RMPD_COMPONENT_FIGURES
Definition: bigdecimal.h:181
VpAsgn
VP_EXPORT size_t VpAsgn(Real *c, Real *a, int isw)
Definition: bigdecimal.c:4505
VpCtoV
VP_EXPORT int VpCtoV(Real *a, const char *int_chr, size_t ni, const char *frac, size_t nf, const char *exp_chr, size_t ne)
Definition: bigdecimal.c:5824
VpFree
VP_EXPORT void VpFree(Real *pv)
Definition: bigdecimal.c:3760
VpToSpecialString
VP_EXPORT int VpToSpecialString(Real *a, char *psz, int fPlus)
Definition: bigdecimal.c:5675
VpGetDoublePosInf
VP_EXPORT double VpGetDoublePosInf(void)
Definition: bigdecimal.c:3941
ptr
struct RIMemo * ptr
Definition: debug.c:88
sym
#define sym(name)
Definition: enumerator.c:4007
str
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
SYM2ID
#define SYM2ID
Definition: symbol.h:45
isinf
int isinf(double n)
Definition: isinf.c:56
DBL_DIG
#define DBL_DIG
Definition: numeric.c:67
RARRAY_EMBED_FLAG
#define RARRAY_EMBED_FLAG
Definition: rarray.h:43
RARRAY
#define RARRAY(obj)
Definition: rarray.h:42
RBASIC
#define RBASIC(obj)
Definition: rbasic.h:34
ruby.h
f
#define f
Real
Definition: bigdecimal.h:246
Real::MaxPrec
size_t MaxPrec
Definition: bigdecimal.h:248
Real::exponent
SIGNED_VALUE exponent
Definition: bigdecimal.h:254
Real::Prec
size_t Prec
Definition: bigdecimal.h:251
Real::flag
short flag
Definition: bigdecimal.h:265
Real::obj
VALUE obj
Definition: bigdecimal.h:247
Real::sign
short sign
Definition: bigdecimal.h:255
ne
#define ne(x, y)
Definition: time.c:92
VALUE
unsigned long VALUE
Definition: value.h:38
SIGNED_VALUE
#define SIGNED_VALUE
Definition: value.h:40
rb_id2str
#define rb_id2str(id)
Definition: vm_backtrace.c:30
isnan
#define isnan(x)
Definition: win32.h:346