lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

Commit f093e66c authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov

поправлены условия расчета функции AMORDEGRC;

поправлена работа с комплексными числами.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58083 954022d7-b5bf-4e40-9824-e11837661b57
parent 24ef8879
...@@ -413,6 +413,7 @@ Complex.prototype = { ...@@ -413,6 +413,7 @@ Complex.prototype = {
hasReal = !hasImag || (this.real != 0); hasReal = !hasImag || (this.real != 0);
if ( hasReal ) { if ( hasReal ) {
res.push( this.real ); res.push( this.real );
} }
if ( hasImag ) { if ( hasImag ) {
...@@ -427,7 +428,7 @@ Complex.prototype = { ...@@ -427,7 +428,7 @@ Complex.prototype = {
else { else {
this.img > 0 && hasReal ? res.push( "+" + this.img ) : res.push( this.img ); this.img > 0 && hasReal ? res.push( "+" + this.img ) : res.push( this.img );
} }
res.push( this.suffix ); res.push( this.suffix ? this.suffix : "i" );
} }
return res.join( "" ); return res.join( "" );
}, },
......
...@@ -885,11 +885,14 @@ cAMORDEGRC.prototype.Calculate = function ( arg ) { ...@@ -885,11 +885,14 @@ cAMORDEGRC.prototype.Calculate = function ( arg ) {
var per = 1 / rate, coeff; var per = 1 / rate, coeff;
if ( cost == salvage || period > per ) { if ( cost == salvage /*|| period > per*/ ) {
return this.value = new cNumber( 0 ); return this.value = new cNumber( 0 );
} }
if ( per >= 3 && per <= 4 ) { if( per < 3){
coeff = 1;
}
else if ( per >= 3 && per <= 4 ) {
coeff = 1.5; coeff = 1.5;
} }
else if ( per >= 5 && per <= 6 ) { else if ( per >= 5 && per <= 6 ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment