mirror of
https://git.code.sf.net/p/newrpl/sources
synced 2024-11-16 19:51:25 +01:00
Fixed bug in root finder.
This commit is contained in:
parent
8dbf6c06f3
commit
50dd862646
1 changed files with 3 additions and 2 deletions
|
@ -287,7 +287,7 @@ WORDPTR rplPolyRootEx(WORDPTR *first,BINT degree)
|
|||
if(Exceptions) { Context.precdigits=oldprec; return 0; }
|
||||
if(iszeroReal(&err) || (intdigitsReal(&err)<-(2*oldprec)))
|
||||
{ pk=rplPopData(); rplOverwriteData(1,pk); } // REAL ROOT ALONE IS STILL GOOD, USE IT
|
||||
|
||||
else { rplPopData(); pk=rplPeekData(1); }
|
||||
}
|
||||
else
|
||||
if( (digre<-10) && (digim>digre+10)) {
|
||||
|
@ -307,7 +307,7 @@ WORDPTR rplPolyRootEx(WORDPTR *first,BINT degree)
|
|||
if(Exceptions) { Context.precdigits=oldprec; return 0; }
|
||||
if(iszeroReal(&err) || (intdigitsReal(&err)<-(2*oldprec)))
|
||||
{ pk=rplPopData(); rplOverwriteData(1,pk); } // IMAG. ROOT ALONE IS STILL GOOD, USE IT
|
||||
|
||||
else { rplPopData(); pk=rplPeekData(1); }
|
||||
}
|
||||
|
||||
|
||||
|
@ -342,6 +342,7 @@ WORDPTR rplPolyRootEx(WORDPTR *first,BINT degree)
|
|||
if(Exceptions) { Context.precdigits=oldprec; return 0; }
|
||||
if(iszeroReal(&err) || (intdigitsReal(&err)<-(2*oldprec)))
|
||||
{ pk=rplPopData(); rplOverwriteData(1,pk); } // INTEGER ROOT ALONE IS STILL GOOD, USE IT
|
||||
else { rplPopData(); pk=rplPeekData(1); }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue