protected static Ptg calcPRICEDISC( Ptg[] operands )
	{
		if( operands.length < 4 )
		{ // not supported by function
			return new PtgErr( PtgErr.ERROR_NULL );
		}
			debugOperands( operands, "calcPRICEDISC" );
		try
		{
			GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() );
			GregorianCalendar mDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[1].getValue() );
			double discount = operands[2].getDoubleVal();
			double redemption = operands[3].getDoubleVal();
			int basis = 0;
			if( operands.length > 4 )
			{
				basis = operands[4].getIntVal();
			}

			//	 TODO: if dates are not valid, return #VALUE! error
			if( (basis < 0) || (basis > 4) )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}
			if( !sDate.before( mDate ) )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}
			if( redemption <= 0 )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}

			long settlementDate = (new Double( DateConverter.getXLSDateVal( sDate ) )).longValue();
			long maturityDate = (new Double( DateConverter.getXLSDateVal( mDate ) )).longValue();

		/*
		 * Ptg[] ops; if (operands.length > 6) ops = new Ptg[4]; else ops = new
		 * Ptg[3]; ops[0] = operands[0]; ops[1] = operands[1]; ops[2] =
		 * operands[5]; if (operands.length > 6) ops[3] = operands[6];
		 */
			double result = redemption - (discount * redemption * yearFrac( basis, settlementDate, maturityDate ));
			PtgNumber pnum = new PtgNumber( result );
				log.debug( "Result from calcPRICEDISC= " + result );
			return pnum;
		}
		catch( Exception e )
		{
		}
		return new PtgErr( PtgErr.ERROR_VALUE );
	}