mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Forgot to round '*'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e1a6b435db
commit
0ec8683145
1 changed files with 6 additions and 5 deletions
|
@ -2026,7 +2026,7 @@ VpAsgn(Real *c, Real *a, int isw)
|
||||||
if(c->Prec < a->Prec) {
|
if(c->Prec < a->Prec) {
|
||||||
VpInternalRound(c,n,(n>0)?a->frac[n-1]:0,a->frac[n]);
|
VpInternalRound(c,n,(n>0)?a->frac[n-1]:0,a->frac[n]);
|
||||||
} else {
|
} else {
|
||||||
VpLimitRound(c,0);
|
VpLimitRound(c,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2589,12 +2589,13 @@ VpMult(Real *c, Real *a, Real *b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VpNmlz(c); /* normalize the result */
|
|
||||||
if(w != NULL) { /* free work variable */
|
if(w != NULL) { /* free work variable */
|
||||||
|
VpNmlz(c);
|
||||||
VpAsgn(w, c, 1);
|
VpAsgn(w, c, 1);
|
||||||
VpFree(c);
|
VpFree(c);
|
||||||
c = w;
|
c = w;
|
||||||
|
} else {
|
||||||
|
VpLimitRound(c,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
@ -3821,7 +3822,8 @@ static int
|
||||||
VpLimitRound(Real *c,U_LONG ixDigit)
|
VpLimitRound(Real *c,U_LONG ixDigit)
|
||||||
{
|
{
|
||||||
U_LONG ix = VpGetPrecLimit();
|
U_LONG ix = VpGetPrecLimit();
|
||||||
if(!ix) return 0;
|
if(!VpNmlz(c)) return -1;
|
||||||
|
if(!ix) return 0;
|
||||||
if(!ixDigit) ixDigit = c->Prec-1;
|
if(!ixDigit) ixDigit = c->Prec-1;
|
||||||
if((ix+BASE_FIG-1)/BASE_FIG > ixDigit+1) return 0;
|
if((ix+BASE_FIG-1)/BASE_FIG > ixDigit+1) return 0;
|
||||||
return VpLeftRound(c,VpGetRoundMode(),ix);
|
return VpLeftRound(c,VpGetRoundMode(),ix);
|
||||||
|
@ -3832,7 +3834,6 @@ VpInternalRound(Real *c,int ixDigit,U_LONG vPrev,U_LONG v)
|
||||||
{
|
{
|
||||||
int f = 0;
|
int f = 0;
|
||||||
|
|
||||||
if(!VpNmlz(c)) return;
|
|
||||||
if(VpLimitRound(c,ixDigit)) return;
|
if(VpLimitRound(c,ixDigit)) return;
|
||||||
if(!v) return;
|
if(!v) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue