protected static Ptg calcRoundDown( Ptg[] operands ) throws CalculationException
	{
		if( operands.length < 1 )
		{
			return PtgCalculator.getNAError();
		}
		double[] dd = PtgCalculator.getDoubleValueArray( operands );
		if( dd == null )
		{
			return new PtgErr( PtgErr.ERROR_NA );//20090130 KSC: propagate error
		}
		//if (dd.length != 2) return PtgCalculator.getError();
		double num = dd[0];
		double round = dd[dd.length - 1];
		double res = 0;
		if( round == 0 )
		{//return an int
			res = Math.round( num );
			if( res > num )
			{
				res--;
			}
		}
		else if( round > 0 )
		{ //round the decimal that number of spaces
			double tempnum = num * Math.pow( 10, round );
			double tempnum2 = Math.round( tempnum );
			if( tempnum2 > tempnum )
			{
				tempnum2--;
			}
			res = tempnum2 / Math.pow( 10, round );
		}
		else
		{ //round up the decimal that numbe of places
			round = round * -1;
			double tempnum = num / Math.pow( 10, round );
			double tempnum2 = Math.round( tempnum );
			if( tempnum2 > tempnum )
			{
				tempnum2--;
			}
			res = tempnum2 * Math.pow( 10, round );
		}
		PtgNumber ptnum = new PtgNumber( res );
		return ptnum;
	}