protected static Ptg calcPRICEMAT( Ptg[] operands )
	{
		if( operands.length < 4 )
		{ // not supported by function
			return new PtgErr( PtgErr.ERROR_NULL );
		}
			debugOperands( operands, "calcPRICEMAT" );
		try
		{
			GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() );
			GregorianCalendar mDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[1].getValue() );
			GregorianCalendar iDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[2].getValue() );
			double rate = operands[3].getDoubleVal();
			double yld = operands[4].getDoubleVal();
			int basis = 0;
			if( operands.length > 5 )
			{
				basis = operands[5].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( (rate < 0) || (yld < 0) )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}

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

			double B = getDaysInYearFromBasis( basis, settlementDate, maturityDate );
			double DSM = getDaysFromBasis( basis, settlementDate, maturityDate );
			double DIM = getDaysFromBasis( basis, issueDate, maturityDate );
			double A = getDaysFromBasis( basis, issueDate, settlementDate );

			double result = (100 + ((DIM / B) * rate * 100)) / (1 + ((DSM / B) * yld));
			result -= (A / B) * rate * 100;
			PtgNumber pnum = new PtgNumber( result );
				log.debug( "Result from calcPRICEMAT= " + result );
			return pnum;
		}
		catch( Exception e )
		{
		}
		return new PtgErr( PtgErr.ERROR_VALUE );
	}