protected static Ptg calcNPER( Ptg[] operands )
	{
		if( operands.length < 3 )
		{
			PtgErr perr = new PtgErr( PtgErr.ERROR_NULL );
			return perr;
		}
			debugOperands( operands, "calcNPER" );
		double rate = operands[0].getDoubleVal();
		double pmt = operands[1].getDoubleVal();
		double pv = operands[2].getDoubleVal();
		double fv = 0;
		if( (operands.length > 3) && !(operands[3] instanceof PtgMissArg) )
		{
			fv = operands[3].getDoubleVal();
		}
		int type = 0;
		if( operands.length > 4 )
		{
			type = operands[4].getIntVal();
		}

		double A = (pmt * (1 + (type * rate))) - (rate * fv);
		double B = (pmt * (1 + (type * rate))) + (rate * pv);
		double C = 1 + rate;
		double result = Math.log( A / B ) / Math.log( C );
			log.debug( "Result from calcNPER= " + result );
		PtgNumber pnum = new PtgNumber( result );
		return pnum;
	}