1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
shigek 2003-08-05 09:31:36 +00:00
parent 808aa5f318
commit 70903de1cd

View file

@ -3208,6 +3208,7 @@ VpToString(Real *a,char *psz,int fFmt)
--ex;
n /= 10;
}
while(psz[-1]=='0') *(--psz) = 0;
sprintf(psz, "E%ld", ex);
} else {
if(VpIsPosZero(a)) sprintf(psz, "0.0");
@ -3845,6 +3846,7 @@ VpFrac(Real *y, Real *x)
VpAsgn(y, x, 1);
goto Exit;
}
y->Prec = x->Prec -(U_LONG) x->exponent;
y->Prec = Min(y->Prec, y->MaxPrec);
y->exponent = 0;
@ -3852,11 +3854,12 @@ VpFrac(Real *y, Real *x)
ind_y = 0;
my = y->Prec;
ind_x = x->exponent;
while(ind_y <= my) {
while(ind_y < my) {
y->frac[ind_y] = x->frac[ind_x];
++ind_y;
++ind_x;
}
VpNmlz(y);
Exit:
#ifdef _DEBUG