protected static Ptg calcOct2Hex( Ptg[] operands )
	{
		if( operands.length < 1 )
		{
			return new PtgErr( PtgErr.ERROR_NULL );
		}
		debugOperands( operands, "OCT2HEX" );
		long l = (long) operands[0].getDoubleVal(); // avoid sci notation
		String oString = String.valueOf( l ).trim();
		// 10 digits at most (=30 bits)
		if( oString.length() > 10 )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		int places = 0;
		if( operands.length > 1 )
		{
			places = operands[1].getIntVal();
		}

		long dec;
		String hString;
		try
		{
			dec = Long.parseLong( oString, 8 );
			// must det. manually if binary string is negative because parseInt/parseLong does not
			// handle two's complement input!!!
			if( dec >= 536870912L )        // 2^29 (= 30 bits, signed)
			{
				dec -= 1073741824L;        // 2^30 (= 31 bits, signed)
			}
			hString = Long.toHexString( dec ).toUpperCase();
		}
		catch( Exception e )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		if( dec < 0 )
		{    // truncate to 10 digits automatically (should already be two's complement)
			hString = hString.substring( Math.max( hString.length() - 10, 0 ) );
		}
		else if( places > 0 )
		{
			if( hString.length() > places )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}
			hString = ("0000000000" + hString);    // maximum= 10 bits
			hString = hString.substring( hString.length() - places );
		}

		PtgStr pstr = new PtgStr( hString );
		log.debug( "Result from OCT2HEX= " + pstr.getString() );
		return pstr;
	}