diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-22 11:43:38 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-22 11:43:38 +0000 |
commit | f35226a4221a46fba7bf9bad2c7a99b015cd5590 (patch) | |
tree | 9db4405454cb50090402b1b6509b1d86fff5568d /ext/bigdecimal | |
parent | c59b918892beb5ac7d7884beca12928c1f7dd1d5 (diff) | |
download | ruby-f35226a4221a46fba7bf9bad2c7a99b015cd5590.tar.gz ruby-f35226a4221a46fba7bf9bad2c7a99b015cd5590.tar.xz ruby-f35226a4221a46fba7bf9bad2c7a99b015cd5590.zip |
* ext/bigdecimal/bigdecimal.c (BigDecimalCmp): BigDecimal#<=> should
return nil if an argument can't be coerced into BigDecimal.
* ext/bigdecimal/bigdecimal.h, ext/bigdecimal/bigdecimal.c
(VpIsNegDoubleZero, VpItoV): comment out unused functions.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 8 | ||||
-rw-r--r-- | ext/bigdecimal/bigdecimal.h | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 013293365..614032953 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -730,11 +730,11 @@ BigDecimalCmp(VALUE self, VALUE r,char op) GUARD_OBJ(a,GetVpValue(self,1)); b = GetVpValue(r,0); if(!b) { - ID f; + ID f = 0; switch(op) { - case '*': return INT2FIX(e); /* any op */ + case '*': return Qnil; /* any op */ case '=': f = rb_intern("=="); break; case '!': f = rb_intern("!="); break; case 'G': f = rb_intern(">="); break; @@ -2196,12 +2196,14 @@ VpGetDoubleNegZero(void) /* Returns the value of -0 */ return nzero; } +#if 0 /* unused */ VP_EXPORT int VpIsNegDoubleZero(double v) { double z = VpGetDoubleNegZero(); return MemCmp(&v,&z,sizeof(v))==0; } +#endif VP_EXPORT int VpException(unsigned short f, const char *str,int always) @@ -4173,6 +4175,7 @@ Exit: /* * m <- ival */ +#if 0 /* unused */ VP_EXPORT void VpItoV(Real *m, S_INT ival) { @@ -4230,6 +4233,7 @@ Exit: #endif /* _DEBUG */ return; } +#endif /* * y = SQRT(x), y*y - x =>0 diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h index 4f77feab0..3a300f1df 100644 --- a/ext/bigdecimal/bigdecimal.h +++ b/ext/bigdecimal/bigdecimal.h @@ -127,7 +127,9 @@ VP_EXPORT unsigned long VpGetRoundMode(void); VP_EXPORT unsigned long VpSetRoundMode(unsigned long n); VP_EXPORT int VpException(unsigned short f,const char *str,int always); +#if 0 /* unused */ VP_EXPORT int VpIsNegDoubleZero(double v); +#endif VP_EXPORT U_LONG VpNumOfChars(Real *vp,const char *pszFmt); VP_EXPORT U_LONG VpInit(U_LONG BaseVal); VP_EXPORT void *VpMemAlloc(U_LONG mb); @@ -146,7 +148,9 @@ VP_EXPORT void VpToFString(Real *a,char *psz,int fFmt,int fPlus); VP_EXPORT int VpCtoV(Real *a,const char *int_chr,U_LONG ni,const char *frac,U_LONG nf,const char *exp_chr,U_LONG ne); VP_EXPORT int VpVtoD(double *d,S_LONG *e,Real *m); VP_EXPORT void VpDtoV(Real *m,double d); +#if 0 /* unused */ VP_EXPORT void VpItoV(Real *m,S_INT ival); +#endif VP_EXPORT int VpSqrt(Real *y,Real *x); VP_EXPORT int VpActiveRound(Real *y,Real *x,int f,int il); VP_EXPORT int VpMidRound(Real *y, int f, int nf); |