Ruby
2.5.0dev(2017-10-22revision60238)
|
Go to the source code of this file.
Data Structures | |
struct | Real |
Macros | |
#define | RUBY_NO_OLD_COMPATIBILITY |
#define | BDIGIT uint16_t |
#define | BDIGIT_DBL uint32_t |
#define | BDIGIT_DBL_SIGNED int32_t |
#define | SIZEOF_BDIGITS 2 |
#define | PRI_BDIGIT_PREFIX "h" |
#define | PRI_BDIGIT_DBL_PREFIX "" |
#define | PRIdBDIGIT PRI_BDIGIT_PREFIX"d" |
#define | PRIiBDIGIT PRI_BDIGIT_PREFIX"i" |
#define | PRIoBDIGIT PRI_BDIGIT_PREFIX"o" |
#define | PRIuBDIGIT PRI_BDIGIT_PREFIX"u" |
#define | PRIxBDIGIT PRI_BDIGIT_PREFIX"x" |
#define | PRIXBDIGIT PRI_BDIGIT_PREFIX"X" |
#define | PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" |
#define | PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" |
#define | PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" |
#define | PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" |
#define | PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" |
#define | PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" |
#define | vabs abs |
#define | RMPD_COMPONENT_FIGURES 4 |
#define | RMPD_BASE ((BDIGIT)10000U) |
#define | SZ_NaN "NaN" |
#define | SZ_INF "Infinity" |
#define | SZ_PINF "+Infinity" |
#define | SZ_NINF "-Infinity" |
#define | VP_EXPORT static |
#define | VP_EXCEPTION_ALL ((unsigned short)0x00FF) |
#define | VP_EXCEPTION_INFINITY ((unsigned short)0x0001) |
#define | VP_EXCEPTION_NaN ((unsigned short)0x0002) |
#define | VP_EXCEPTION_UNDERFLOW ((unsigned short)0x0004) |
#define | VP_EXCEPTION_OVERFLOW ((unsigned short)0x0001) /* 0x0008) */ |
#define | VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0010) |
#define | VP_EXCEPTION_OP ((unsigned short)0x0020) |
#define | VP_EXCEPTION_MEMORY ((unsigned short)0x0040) |
#define | RMPD_EXCEPTION_MODE_DEFAULT 0U |
#define | VP_ROUND_MODE ((unsigned short)0x0100) |
#define | VP_ROUND_UP 1 |
#define | VP_ROUND_DOWN 2 |
#define | VP_ROUND_HALF_UP 3 |
#define | VP_ROUND_HALF_DOWN 4 |
#define | VP_ROUND_CEIL 5 |
#define | VP_ROUND_FLOOR 6 |
#define | VP_ROUND_HALF_EVEN 7 |
#define | RMPD_ROUNDING_MODE_DEFAULT VP_ROUND_HALF_UP |
#define | VP_SIGN_NaN 0 /* NaN */ |
#define | VP_SIGN_POSITIVE_ZERO 1 /* Positive zero */ |
#define | VP_SIGN_NEGATIVE_ZERO -1 /* Negative zero */ |
#define | VP_SIGN_POSITIVE_FINITE 2 /* Positive finite number */ |
#define | VP_SIGN_NEGATIVE_FINITE -2 /* Negative finite number */ |
#define | VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */ |
#define | VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */ |
#define | FLEXIBLE_ARRAY_SIZE 1 |
#define | VpBaseFig() rmpd_component_figures() |
#define | VpDblFig() rmpd_double_figures() |
#define | VpBaseVal() rmpd_base_value() |
#define | Abs(a) (((a)>= 0)?(a):(-(a))) |
#define | Max(a, b) (((a)>(b))?(a):(b)) |
#define | Min(a, b) (((a)>(b))?(b):(a)) |
#define | VpMaxPrec(a) ((a)->MaxPrec) |
#define | VpPrec(a) ((a)->Prec) |
#define | VpGetFlag(a) ((a)->flag) |
#define | VpGetSign(a) (((a)->sign>0)?1:(-1)) |
#define | VpChangeSign(a, s) {if((s)>0) (a)->sign=(short)Abs((ssize_t)(a)->sign);else (a)->sign=-(short)Abs((ssize_t)(a)->sign);} |
#define | VpSetSign(a, s) {if((s)>0) (a)->sign=(short)VP_SIGN_POSITIVE_FINITE;else (a)->sign=(short)VP_SIGN_NEGATIVE_FINITE;} |
#define | VpSetOne(a) {(a)->Prec=(a)->exponent=(a)->frac[0]=1;(a)->sign=VP_SIGN_POSITIVE_FINITE;} |
#define | VpIsPosZero(a) ((a)->sign==VP_SIGN_POSITIVE_ZERO) |
#define | VpIsNegZero(a) ((a)->sign==VP_SIGN_NEGATIVE_ZERO) |
#define | VpIsZero(a) (VpIsPosZero(a) || VpIsNegZero(a)) |
#define | VpSetPosZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_ZERO) |
#define | VpSetNegZero(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_ZERO) |
#define | VpSetZero(a, s) (void)(((s)>0)?VpSetPosZero(a):VpSetNegZero(a)) |
#define | VpIsNaN(a) ((a)->sign==VP_SIGN_NaN) |
#define | VpSetNaN(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NaN) |
#define | VpIsPosInf(a) ((a)->sign==VP_SIGN_POSITIVE_INFINITE) |
#define | VpIsNegInf(a) ((a)->sign==VP_SIGN_NEGATIVE_INFINITE) |
#define | VpIsInf(a) (VpIsPosInf(a) || VpIsNegInf(a)) |
#define | VpIsDef(a) ( !(VpIsNaN(a)||VpIsInf(a)) ) |
#define | VpSetPosInf(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_INFINITE) |
#define | VpSetNegInf(a) ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_INFINITE) |
#define | VpSetInf(a, s) (void)(((s)>0)?VpSetPosInf(a):VpSetNegInf(a)) |
#define | VpHasVal(a) (a->frac[0]) |
#define | VpIsOne(a) ((a->Prec==1)&&(a->frac[0]==1)&&(a->exponent==1)) |
#define | VpExponent(a) (a->exponent) |
Functions | |
VP_EXPORT Real * | VpNewRbClass (size_t mx, char const *str, VALUE klass) |
VP_EXPORT Real * | VpCreateRbObject (size_t mx, const char *str) |
VP_EXPORT double | VpGetDoubleNaN (void) |
VP_EXPORT double | VpGetDoublePosInf (void) |
VP_EXPORT double | VpGetDoubleNegInf (void) |
VP_EXPORT double | VpGetDoubleNegZero (void) |
VP_EXPORT size_t | VpGetPrecLimit (void) |
VP_EXPORT size_t | VpSetPrecLimit (size_t n) |
VP_EXPORT int | VpIsRoundMode (unsigned short n) |
VP_EXPORT unsigned short | VpGetRoundMode (void) |
VP_EXPORT unsigned short | VpSetRoundMode (unsigned short n) |
VP_EXPORT int | VpException (unsigned short f, const char *str, int always) |
VP_EXPORT size_t | VpNumOfChars (Real *vp, const char *pszFmt) |
VP_EXPORT size_t | VpInit (BDIGIT BaseVal) |
VP_EXPORT void * | VpMemAlloc (size_t mb) |
VP_EXPORT void * | VpMemRealloc (void *ptr, size_t mb) |
VP_EXPORT void | VpFree (Real *pv) |
VP_EXPORT Real * | VpAlloc (size_t mx, const char *szVal) |
VP_EXPORT size_t | VpAsgn (Real *c, Real *a, int isw) |
VP_EXPORT size_t | VpAddSub (Real *c, Real *a, Real *b, int operation) |
VP_EXPORT size_t | VpMult (Real *c, Real *a, Real *b) |
VP_EXPORT size_t | VpDivd (Real *c, Real *r, Real *a, Real *b) |
VP_EXPORT int | VpComp (Real *a, Real *b) |
VP_EXPORT ssize_t | VpExponent10 (Real *a) |
VP_EXPORT void | VpSzMantissa (Real *a, char *psz) |
VP_EXPORT int | VpToSpecialString (Real *a, char *psz, int fPlus) |
VP_EXPORT void | VpToString (Real *a, char *psz, size_t fFmt, int fPlus) |
VP_EXPORT void | VpToFString (Real *a, char *psz, size_t fFmt, int fPlus) |
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) |
VP_EXPORT int | VpVtoD (double *d, SIGNED_VALUE *e, Real *m) |
VP_EXPORT void | VpDtoV (Real *m, double d) |
VP_EXPORT int | VpSqrt (Real *y, Real *x) |
VP_EXPORT int | VpActiveRound (Real *y, Real *x, unsigned short f, ssize_t il) |
VP_EXPORT int | VpMidRound (Real *y, unsigned short f, ssize_t nf) |
VP_EXPORT int | VpLeftRound (Real *y, unsigned short f, ssize_t nf) |
VP_EXPORT void | VpFrac (Real *y, Real *x) |
VP_EXPORT int | VpPower (Real *y, Real *x, SIGNED_VALUE n) |
VP_EXPORT Real * | VpOne (void) |
Variables | |
VALUE | rb_cBigDecimal |
#define Abs | ( | a | ) | (((a)>= 0)?(a):(-(a))) |
Definition at line 335 of file bigdecimal.h.
#define BDIGIT uint16_t |
Definition at line 48 of file bigdecimal.h.
Referenced by rb_absint_singlebit_p(), rb_absint_size(), rb_big_and(), rb_big_aref(), rb_big_bit_length(), rb_big_comp(), rb_big_divrem_normal(), rb_big_eql(), rb_big_even_p(), rb_big_isqrt(), rb_big_or(), rb_big_xor(), rb_integer_pack(), rb_integer_unpack(), rb_uint2big(), VpAddSub(), VpAsgn(), VpComp(), VpDivd(), VpDtoV(), VpLeftRound(), VpMidRound(), VpMult(), VpToFString(), and VpToString().
#define BDIGIT_DBL uint32_t |
Definition at line 49 of file bigdecimal.h.
Referenced by rb_big_even_p(), VpDivd(), VpMult(), and VpSzMantissa().
#define BDIGIT_DBL_SIGNED int32_t |
Definition at line 50 of file bigdecimal.h.
#define FLEXIBLE_ARRAY_SIZE 1 |
Definition at line 227 of file bigdecimal.h.
#define Max | ( | a, | |
b | |||
) | (((a)>(b))?(a):(b)) |
Definition at line 336 of file bigdecimal.h.
Referenced by VpAlloc().
#define Min | ( | a, | |
b | |||
) | (((a)>(b))?(b):(a)) |
Definition at line 337 of file bigdecimal.h.
#define PRI_BDIGIT_DBL_PREFIX "" |
Definition at line 53 of file bigdecimal.h.
#define PRI_BDIGIT_PREFIX "h" |
Definition at line 52 of file bigdecimal.h.
#define PRIdBDIGIT PRI_BDIGIT_PREFIX"d" |
Definition at line 56 of file bigdecimal.h.
#define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" |
Definition at line 63 of file bigdecimal.h.
#define PRIiBDIGIT PRI_BDIGIT_PREFIX"i" |
Definition at line 57 of file bigdecimal.h.
#define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" |
Definition at line 64 of file bigdecimal.h.
#define PRIoBDIGIT PRI_BDIGIT_PREFIX"o" |
Definition at line 58 of file bigdecimal.h.
#define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" |
Definition at line 65 of file bigdecimal.h.
#define PRIuBDIGIT PRI_BDIGIT_PREFIX"u" |
Definition at line 59 of file bigdecimal.h.
#define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" |
Definition at line 66 of file bigdecimal.h.
#define PRIxBDIGIT PRI_BDIGIT_PREFIX"x" |
Definition at line 60 of file bigdecimal.h.
#define PRIXBDIGIT PRI_BDIGIT_PREFIX"X" |
Definition at line 61 of file bigdecimal.h.
#define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" |
Definition at line 67 of file bigdecimal.h.
#define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" |
Definition at line 68 of file bigdecimal.h.
#define RMPD_BASE ((BDIGIT)10000U) |
Definition at line 169 of file bigdecimal.h.
#define RMPD_COMPONENT_FIGURES 4 |
Definition at line 168 of file bigdecimal.h.
Referenced by VpComp().
#define RMPD_EXCEPTION_MODE_DEFAULT 0U |
Definition at line 202 of file bigdecimal.h.
#define RMPD_ROUNDING_MODE_DEFAULT VP_ROUND_HALF_UP |
Definition at line 214 of file bigdecimal.h.
#define RUBY_NO_OLD_COMPATIBILITY |
Definition at line 12 of file bigdecimal.h.
#define SIZEOF_BDIGITS 2 |
Definition at line 51 of file bigdecimal.h.
#define SZ_INF "Infinity" |
Definition at line 180 of file bigdecimal.h.
Referenced by VpAlloc(), VpComp(), VpSzMantissa(), and VpToSpecialString().
#define SZ_NaN "NaN" |
Definition at line 179 of file bigdecimal.h.
Referenced by VpAlloc(), VpComp(), VpSzMantissa(), and VpToSpecialString().
#define SZ_NINF "-Infinity" |
Definition at line 182 of file bigdecimal.h.
Referenced by VpAlloc(), VpComp(), VpSzMantissa(), and VpToSpecialString().
#define SZ_PINF "+Infinity" |
Definition at line 181 of file bigdecimal.h.
Referenced by VpAlloc().
#define vabs abs |
Definition at line 149 of file bigdecimal.h.
#define VP_EXCEPTION_ALL ((unsigned short)0x00FF) |
Definition at line 191 of file bigdecimal.h.
#define VP_EXCEPTION_INFINITY ((unsigned short)0x0001) |
Definition at line 192 of file bigdecimal.h.
#define VP_EXCEPTION_MEMORY ((unsigned short)0x0040) |
Definition at line 200 of file bigdecimal.h.
Referenced by VpMemAlloc(), and VpMemRealloc().
#define VP_EXCEPTION_NaN ((unsigned short)0x0002) |
Definition at line 193 of file bigdecimal.h.
#define VP_EXCEPTION_OP ((unsigned short)0x0020) |
Definition at line 199 of file bigdecimal.h.
Referenced by VpSqrt().
#define VP_EXCEPTION_OVERFLOW ((unsigned short)0x0001) /* 0x0008) */ |
Definition at line 195 of file bigdecimal.h.
#define VP_EXCEPTION_UNDERFLOW ((unsigned short)0x0004) |
Definition at line 194 of file bigdecimal.h.
#define VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0010) |
Definition at line 196 of file bigdecimal.h.
#define VP_EXPORT static |
Definition at line 188 of file bigdecimal.h.
Referenced by VpAlloc(), VpExponent10(), VpIsRoundMode(), VpLeftRound(), VpMemAlloc(), VpMemRealloc(), VpNewRbClass(), VpNumOfChars(), VpSqrt(), VpSzMantissa(), VpToSpecialString(), and VpVtoD().
#define VP_ROUND_CEIL 5 |
Definition at line 210 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_ROUND_DOWN 2 |
Definition at line 207 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_ROUND_FLOOR 6 |
Definition at line 211 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_ROUND_HALF_DOWN 4 |
Definition at line 209 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_ROUND_HALF_EVEN 7 |
Definition at line 212 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_ROUND_HALF_UP 3 |
Definition at line 208 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_ROUND_MODE ((unsigned short)0x0100) |
Definition at line 205 of file bigdecimal.h.
#define VP_ROUND_UP 1 |
Definition at line 206 of file bigdecimal.h.
Referenced by VpIsRoundMode(), and VpMidRound().
#define VP_SIGN_NaN 0 /* NaN */ |
Definition at line 216 of file bigdecimal.h.
#define VP_SIGN_NEGATIVE_FINITE -2 /* Negative finite number */ |
Definition at line 220 of file bigdecimal.h.
#define VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */ |
Definition at line 222 of file bigdecimal.h.
#define VP_SIGN_NEGATIVE_ZERO -1 /* Negative zero */ |
Definition at line 218 of file bigdecimal.h.
#define VP_SIGN_POSITIVE_FINITE 2 /* Positive finite number */ |
Definition at line 219 of file bigdecimal.h.
#define VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */ |
Definition at line 221 of file bigdecimal.h.
#define VP_SIGN_POSITIVE_ZERO 1 /* Positive zero */ |
Definition at line 217 of file bigdecimal.h.
#define VpBaseFig | ( | ) | rmpd_component_figures() |
Definition at line 275 of file bigdecimal.h.
#define VpBaseVal | ( | ) | rmpd_base_value() |
Definition at line 277 of file bigdecimal.h.
#define VpChangeSign | ( | a, | |
s | |||
) | {if((s)>0) (a)->sign=(short)Abs((ssize_t)(a)->sign);else (a)->sign=-(short)Abs((ssize_t)(a)->sign);} |
Definition at line 348 of file bigdecimal.h.
Referenced by VpSqrt().
#define VpDblFig | ( | ) | rmpd_double_figures() |
Definition at line 276 of file bigdecimal.h.
#define VpExponent | ( | a | ) | (a->exponent) |
Definition at line 377 of file bigdecimal.h.
Referenced by VpLeftRound().
#define VpGetFlag | ( | a | ) | ((a)->flag) |
Definition at line 341 of file bigdecimal.h.
#define VpGetSign | ( | a | ) | (((a)->sign>0)?1:(-1)) |
Definition at line 346 of file bigdecimal.h.
Referenced by VpAsgn(), VpComp(), VpFrac(), VpMidRound(), VpPower(), and VpVtoD().
#define VpHasVal | ( | a | ) | (a->frac[0]) |
Definition at line 375 of file bigdecimal.h.
Referenced by VpExponent10(), VpFrac(), and VpLeftRound().
Definition at line 371 of file bigdecimal.h.
Referenced by VpComp(), and VpNumOfChars().
#define VpIsInf | ( | a | ) | (VpIsPosInf(a) || VpIsNegInf(a)) |
Definition at line 370 of file bigdecimal.h.
#define VpIsNaN | ( | a | ) | ((a)->sign==VP_SIGN_NaN) |
Definition at line 364 of file bigdecimal.h.
Referenced by VpAsgn(), VpComp(), VpPower(), VpSqrt(), VpSzMantissa(), VpToSpecialString(), and VpVtoD().
#define VpIsNegInf | ( | a | ) | ((a)->sign==VP_SIGN_NEGATIVE_INFINITE) |
Definition at line 369 of file bigdecimal.h.
Referenced by VpComp(), VpSzMantissa(), VpToSpecialString(), and VpVtoD().
#define VpIsNegZero | ( | a | ) | ((a)->sign==VP_SIGN_NEGATIVE_ZERO) |
Definition at line 357 of file bigdecimal.h.
Referenced by VpVtoD().
#define VpIsOne | ( | a | ) | ((a->Prec==1)&&(a->frac[0]==1)&&(a->exponent==1)) |
Definition at line 376 of file bigdecimal.h.
Referenced by VpSqrt().
#define VpIsPosInf | ( | a | ) | ((a)->sign==VP_SIGN_POSITIVE_INFINITE) |
Definition at line 368 of file bigdecimal.h.
Referenced by VpComp(), VpPower(), VpSqrt(), VpSzMantissa(), VpToSpecialString(), and VpVtoD().
#define VpIsPosZero | ( | a | ) | ((a)->sign==VP_SIGN_POSITIVE_ZERO) |
Definition at line 356 of file bigdecimal.h.
Referenced by VpSzMantissa(), VpToSpecialString(), and VpVtoD().
#define VpIsZero | ( | a | ) | (VpIsPosZero(a) || VpIsNegZero(a)) |
Definition at line 358 of file bigdecimal.h.
Referenced by VpAsgn(), VpComp(), VpPower(), VpSqrt(), VpSzMantissa(), and VpToSpecialString().
#define VpMaxPrec | ( | a | ) | ((a)->MaxPrec) |
Definition at line 339 of file bigdecimal.h.
#define VpPrec | ( | a | ) | ((a)->Prec) |
Definition at line 340 of file bigdecimal.h.
#define VpSetInf | ( | a, | |
s | |||
) | (void)(((s)>0)?VpSetPosInf(a):VpSetNegInf(a)) |
Definition at line 374 of file bigdecimal.h.
#define VpSetNaN | ( | a | ) | ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NaN) |
#define VpSetNegInf | ( | a | ) | ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_INFINITE) |
Definition at line 373 of file bigdecimal.h.
#define VpSetNegZero | ( | a | ) | ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_NEGATIVE_ZERO) |
Definition at line 360 of file bigdecimal.h.
#define VpSetOne | ( | a | ) | {(a)->Prec=(a)->exponent=(a)->frac[0]=1;(a)->sign=VP_SIGN_POSITIVE_FINITE;} |
Definition at line 353 of file bigdecimal.h.
#define VpSetPosInf | ( | a | ) | ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_INFINITE) |
Definition at line 372 of file bigdecimal.h.
#define VpSetPosZero | ( | a | ) | ((a)->frac[0]=0,(a)->Prec=1,(a)->sign=VP_SIGN_POSITIVE_ZERO) |
Definition at line 359 of file bigdecimal.h.
#define VpSetSign | ( | a, | |
s | |||
) | {if((s)>0) (a)->sign=(short)VP_SIGN_POSITIVE_FINITE;else (a)->sign=(short)VP_SIGN_NEGATIVE_FINITE;} |
#define VpSetZero | ( | a, | |
s | |||
) | (void)(((s)>0)?VpSetPosZero(a):VpSetNegZero(a)) |
Definition at line 361 of file bigdecimal.h.
Referenced by VpAlloc(), VpDtoV(), VpFrac(), VpMidRound(), and VpPower().
Definition at line 6141 of file bigdecimal.c.
References VpAsgn(), and VpMidRound().
Definition at line 4014 of file bigdecimal.c.
References BASE_FIG, buf, ISDIGIT, ISSPACE, Max, Real::MaxPrec, ne, NULL, PRIsVALUE, rb_eArgError, rb_raise(), rb_str_new2, rb_str_resize(), rb_str_tmp_new(), RSTRING_PTR, StrCmp, strlen(), SZ_INF, SZ_NaN, SZ_NINF, SZ_PINF, VP_EXPORT, VpAllocReal, VpCtoV(), VpGetPrecLimit(), VpSetNaN, VpSetNegInf, VpSetPosInf, and VpSetZero.
Referenced by VpInit(), VpNewRbClass(), VpPower(), and VpSqrt().
Definition at line 4180 of file bigdecimal.c.
References BDIGIT, Real::exponent, Real::frac, Real::MaxPrec, Real::Prec, VpGetSign, VpIsInf, VpIsNaN, VpIsZero, VpSetInf, VpSetNaN, and VpSetSign.
Referenced by VpActiveRound(), VpFrac(), VpPower(), and VpSqrt().
Definition at line 5061 of file bigdecimal.c.
References BASE1, BDIGIT, BIGDECIMAL_NEGATIVE_P, Real::exponent, Real::frac, Real::MaxPrec, Real::Prec, PRIdSIZE, PRIdVALUE, RMPD_COMPONENT_FIGURES, Real::sign, SZ_INF, SZ_NaN, SZ_NINF, val, VpExponent10(), VpGetSign, VpIsDef, VpIsNaN, VpIsNegInf, VpIsPosInf, and VpIsZero.
Definition at line 670 of file bigdecimal.c.
References rb_cBigDecimal, and VpNewRbClass().
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 at line 5499 of file bigdecimal.c.
Referenced by VpAlloc().
Definition at line 4808 of file bigdecimal.c.
References BDIGIT, BDIGIT_DBL, and VpSetNaN.
Definition at line 5723 of file bigdecimal.c.
References BASE, BDIGIT, Real::exponent, Real::frac, isinf(), isnan, Real::MaxPrec, ne, Real::Prec, SIGNED_VALUE, val, VpSetNaN, VpSetNegInf, VpSetPosInf, VpSetSign, and VpSetZero.
Referenced by VpSqrt().
Definition at line 3755 of file bigdecimal.c.
Referenced by VpMemAlloc(), VpMemRealloc(), and VpSqrt().
Definition at line 5286 of file bigdecimal.c.
References BASE1, BASE_FIG, Real::exponent, Real::frac, VP_EXPORT, and VpHasVal.
Referenced by VpComp().
Definition at line 6236 of file bigdecimal.c.
References Real::exponent, Real::frac, Real::MaxPrec, Min, Real::Prec, VpAsgn(), VpGetSign, VpHasVal, VpSetSign, and VpSetZero.
VP_EXPORT double VpGetDoubleNaN | ( | void | ) |
Definition at line 3714 of file bigdecimal.c.
VP_EXPORT double VpGetDoubleNegInf | ( | void | ) |
Definition at line 3730 of file bigdecimal.c.
VP_EXPORT double VpGetDoubleNegZero | ( | void | ) |
Definition at line 3738 of file bigdecimal.c.
VP_EXPORT double VpGetDoublePosInf | ( | void | ) |
Definition at line 3722 of file bigdecimal.c.
VP_EXPORT size_t VpGetPrecLimit | ( | void | ) |
Definition at line 3598 of file bigdecimal.c.
References rb_thread_current(), and rb_thread_local_aref().
Referenced by VpAlloc(), and VpSetPrecLimit().
VP_EXPORT unsigned short VpGetRoundMode | ( | void | ) |
Definition at line 3633 of file bigdecimal.c.
References rb_thread_current(), and rb_thread_local_aref().
Referenced by VpSetRoundMode().
Definition at line 3926 of file bigdecimal.c.
References BASE, BASE1, BASE_FIG, DBLE_FIG, HALF_BASE, PRIuBDIGIT, VpAlloc(), VpGetDoubleNaN(), VpGetDoubleNegInf(), VpGetDoubleNegZero(), and VpGetDoublePosInf().
VP_EXPORT int VpIsRoundMode | ( | unsigned short | n | ) |
Definition at line 3649 of file bigdecimal.c.
References VP_EXPORT, VP_ROUND_CEIL, VP_ROUND_DOWN, VP_ROUND_FLOOR, VP_ROUND_HALF_DOWN, VP_ROUND_HALF_EVEN, VP_ROUND_HALF_UP, and VP_ROUND_UP.
Referenced by VpSetRoundMode().
Definition at line 6126 of file bigdecimal.c.
References BASE_FIG, BDIGIT, Real::frac, VP_EXPORT, VpExponent, VpHasVal, and VpMidRound().
VP_EXPORT void* VpMemAlloc | ( | size_t | mb | ) |
Definition at line 3509 of file bigdecimal.c.
References VP_EXCEPTION_MEMORY, VP_EXPORT, VpException(), and xmalloc.
VP_EXPORT void* VpMemRealloc | ( | void * | ptr, |
size_t | mb | ||
) |
Definition at line 3523 of file bigdecimal.c.
References VP_EXCEPTION_MEMORY, VP_EXPORT, VpException(), and xrealloc.
Definition at line 5964 of file bigdecimal.c.
References BASE, BASE_FIG, BDIGIT, BIGDECIMAL_NEGATIVE_P, BIGDECIMAL_POSITIVE_P, div, Real::exponent, Real::frac, Real::Prec, VP_ROUND_CEIL, VP_ROUND_DOWN, VP_ROUND_FLOOR, VP_ROUND_HALF_DOWN, VP_ROUND_HALF_EVEN, VP_ROUND_HALF_UP, VP_ROUND_UP, VpGetSign, and VpSetZero.
Referenced by VpActiveRound(), and VpLeftRound().
Definition at line 4679 of file bigdecimal.c.
References BDIGIT, and BDIGIT_DBL.
Definition at line 660 of file bigdecimal.c.
References Real::obj, RTYPEDDATA_DATA, TypedData_Wrap_Struct, VP_EXPORT, and VpAlloc().
Referenced by VpCreateRbObject().
Definition at line 3882 of file bigdecimal.c.
References BASE_FIG, Real::exponent, NULL, Real::Prec, SIGNED_VALUE, VP_EXPORT, and VpIsDef.
Definition at line 3957 of file bigdecimal.c.
VP_EXPORT int VpPower | ( | Real * | y, |
Real * | x, | ||
SIGNED_VALUE | n | ||
) |
Definition at line 6284 of file bigdecimal.c.
References BASE, BASE_FIG, BIGDECIMAL_POSITIVE_P, Real::exponent, Real::frac, Real::MaxPrec, NULL, Real::Prec, PRIdVALUE, PRIuBDIGIT, PRIuSIZE, SIGNED_VALUE, VpAlloc(), VpAsgn(), VpDivd(), VpFree(), VpGetSign, VpIsInf, VpIsNaN, VpIsPosInf, VpIsZero, VpMult(), VpSetInf, VpSetNaN, VpSetOne, VpSetSign, and VpSetZero.
VP_EXPORT size_t VpSetPrecLimit | ( | size_t | n | ) |
Definition at line 3614 of file bigdecimal.c.
References rmpd_set_thread_local_precision_limit, and VpGetPrecLimit().
VP_EXPORT unsigned short VpSetRoundMode | ( | unsigned short | n | ) |
Definition at line 3667 of file bigdecimal.c.
References rmpd_set_thread_local_rounding_mode, VpGetRoundMode(), and VpIsRoundMode().
Definition at line 5855 of file bigdecimal.c.
References BASE, BASE_FIG, BIGDECIMAL_NEGATIVE_P, DBLE_FIG, Real::exponent, f, if(), maxnr, Real::MaxPrec, Min, NULL, PRIdSIZE, SIGNED_VALUE, val, VP_EXCEPTION_OP, VP_EXPORT, VpAddSub(), VpAlloc(), VpAsgn(), VpChangeSign, VpDivd(), VpDtoV(), VpException(), VpFree(), VpIsNaN, VpIsOne, VpIsPosInf, VpIsZero, VpMult(), VpSetNaN, VpSetOne, and VpVtoD().
Definition at line 5303 of file bigdecimal.c.
References BASE1, BDIGIT_DBL, BIGDECIMAL_NEGATIVE_P, Real::frac, Real::Prec, strlen(), SZ_INF, SZ_NaN, SZ_NINF, VP_EXPORT, VpIsNaN, VpIsNegInf, VpIsPosInf, VpIsPosZero, and VpIsZero.
Definition at line 5433 of file bigdecimal.c.
References BASE, BASE1, BASE_FIG, BDIGIT, BIGDECIMAL_NEGATIVE_P, Real::exponent, Real::frac, Real::Prec, strlen(), and VpToSpecialString().
Definition at line 5350 of file bigdecimal.c.
References SZ_INF, SZ_NaN, SZ_NINF, VP_EXPORT, VpIsNaN, VpIsNegInf, VpIsPosInf, VpIsPosZero, and VpIsZero.
Referenced by VpToFString().
Definition at line 5385 of file bigdecimal.c.
References BDIGIT.
VP_EXPORT int VpVtoD | ( | double * | d, |
SIGNED_VALUE * | e, | ||
Real * | m | ||
) |
Definition at line 5659 of file bigdecimal.c.
References BASE, BASE_FIG, DBLE_FIG, div, Real::exponent, f, Real::frac, Min, Real::Prec, SIGNED_VALUE, VP_EXPORT, VpGetDoubleNaN(), VpGetDoubleNegInf(), VpGetDoubleNegZero(), VpGetDoublePosInf(), VpGetSign, VpIsNaN, VpIsNegInf, VpIsNegZero, VpIsPosInf, and VpIsPosZero.
Referenced by VpSqrt().
VALUE rb_cBigDecimal |
Definition at line 45 of file bigdecimal.c.
Referenced by VpCreateRbObject().