protected static Ptg calcYearFrac( Ptg[] operands )
	{
		long startDate;
		long endDate;
		try
		{
			GregorianCalendar d = getDateFromPtg( operands[0] );
			startDate = (new Double( DateConverter.getXLSDateVal( d ) )).longValue();
			d = getDateFromPtg( operands[1] );
			endDate = (new Double( DateConverter.getXLSDateVal( d ) )).longValue();
		}
		catch( Exception e )
		{
			//If start_date or end_date are not valid dates, YEARFRAC returns the #VALUE! error value.
			return new PtgErr( PtgErr.ERROR_VALUE );
		}
		int basis = 0;
		if( operands.length > 2 )
		{
			basis = operands[2].getIntVal();
		}
		//If basis < 0 or if basis > 4, YEARFRAC returns the #NUM! error value.
		if( (basis < 0) || (basis > 4) )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		double yf = FinancialCalculator.yearFrac( basis, startDate, endDate );
		if( yf < 0 )
		{
			yf *= -1;    // =# days between dates, no negatives
		}
		return new PtgNumber( yf );
	}