protected static Ptg calcDDB( Ptg[] operands )
	{
		if( (operands.length < 4) || (operands[0].getComponents() != null) )
		{ // not
			// supported
			// by
			// function
			PtgErr perr = new PtgErr( PtgErr.ERROR_NULL );
			return perr;
		}
		double cost;
		double salvage;
		int life;
		int period;
		int factor;
		cost = new Double( String.valueOf( operands[0].getValue() ) );
		salvage = new Double( String.valueOf( operands[1].getValue() ) );
		life = Integer.valueOf( String.valueOf( operands[2].getValue() ) );
		period = Integer.valueOf( String.valueOf( operands[3].getValue() ) );
		factor = 2;
		if( operands.length > 4 )
		{
			if( !(operands[4] instanceof PtgMissArg) )
			{
				factor = Integer.valueOf( String.valueOf( operands[4].getValue() ) );
			}
		}
		double salCost = salvage / cost;
		// this section longhand due to some wierd calcs when calling lifdiv =
		// 1/life;
		double facLife = factor / ((double) life);
		double totalDepreciation = 0;
/*	original calc	
		for (int i = 1; i < period; i++) {
			//((cost-salvage) - total depreciation from prior periods) * (factor/life)
			totalDepreciation += (cost - salvage - totalDepreciation)*facLife;
		}
//		double result= (cost - salvage - totalDepreciation) * (facLife);
 *	 
 */
		for( int i = 1; i < period; i++ )
		{
			totalDepreciation += (cost - totalDepreciation) * facLife;
		}
		double result = 0.0;
		if( (cost - salvage - totalDepreciation) > 0 )
		{
			result = (cost - totalDepreciation) * facLife;
		}
		PtgNumber pnum = new PtgNumber( result );
		return pnum;
	}