Trailing 0s in to_s removed. & Bug in VpFrac fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
808aa5f318
commit
70903de1cd
@ -3208,6 +3208,7 @@ VpToString(Real *a,char *psz,int fFmt)
|
|||||||
--ex;
|
--ex;
|
||||||
n /= 10;
|
n /= 10;
|
||||||
}
|
}
|
||||||
|
while(psz[-1]=='0') *(--psz) = 0;
|
||||||
sprintf(psz, "E%ld", ex);
|
sprintf(psz, "E%ld", ex);
|
||||||
} else {
|
} else {
|
||||||
if(VpIsPosZero(a)) sprintf(psz, "0.0");
|
if(VpIsPosZero(a)) sprintf(psz, "0.0");
|
||||||
@ -3845,6 +3846,7 @@ VpFrac(Real *y, Real *x)
|
|||||||
VpAsgn(y, x, 1);
|
VpAsgn(y, x, 1);
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
y->Prec = x->Prec -(U_LONG) x->exponent;
|
y->Prec = x->Prec -(U_LONG) x->exponent;
|
||||||
y->Prec = Min(y->Prec, y->MaxPrec);
|
y->Prec = Min(y->Prec, y->MaxPrec);
|
||||||
y->exponent = 0;
|
y->exponent = 0;
|
||||||
@ -3852,11 +3854,12 @@ VpFrac(Real *y, Real *x)
|
|||||||
ind_y = 0;
|
ind_y = 0;
|
||||||
my = y->Prec;
|
my = y->Prec;
|
||||||
ind_x = x->exponent;
|
ind_x = x->exponent;
|
||||||
while(ind_y <= my) {
|
while(ind_y < my) {
|
||||||
y->frac[ind_y] = x->frac[ind_x];
|
y->frac[ind_y] = x->frac[ind_x];
|
||||||
++ind_y;
|
++ind_y;
|
||||||
++ind_x;
|
++ind_x;
|
||||||
}
|
}
|
||||||
|
VpNmlz(y);
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user