protected static Ptg calcHex2Dec( Ptg[] operands )
	{
		if( operands.length < 1 )
		{
			return new PtgErr( PtgErr.ERROR_NULL );
		}
		debugOperands( operands, "HEX2DEC" );
		String hString = operands[0].getString().trim();
		// 10 digits (40 bits) at most
		if( hString.length() > 10 )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		long dec;
		String oString;
		try
		{
			dec = Long.parseLong( hString, 16 );
			// must det. manually if binary string is negative because parseInt/parseLong does not
			// handle two's complement input!!!
			if( dec >= 549755813888L )        // 2^39 (= signed 40 bits)
			{
				dec -= 1099511627776L;        // 2^40 (= signed 41 bits)
			}
		}
		catch( Exception e )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		PtgNumber pnum = new PtgNumber( dec );
		log.debug( "Result from HEX2DEC= " + pnum.getVal() );
		return pnum;
	}