protected static Ptg calcGCD( Ptg[] operands )
	{
		if( operands.length < 1 )
		{
			return PtgCalculator.getNAError();
		}
		Ptg[] numbers = PtgCalculator.getAllComponents( operands );
		long gcd = 0;
		try
		{
			long n1;
			if( (n1 = PtgCalculator.getLongValue( numbers[0] )) < 0 )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}

			gcd = n1;
			for( int i = 1; i < numbers.length; i++ )
			{
				long n2;
				if( (n2 = PtgCalculator.getLongValue( numbers[i] )) < 0 )
				{
					return new PtgErr( PtgErr.ERROR_NUM );
				}

				long bigger;
				long smaller;
				long r;
				bigger = Math.max( n2, n1 );
				smaller = Math.min( n2, n1 );
				r = bigger % smaller;
				while( r != 0 )
				{
					bigger = smaller;
					smaller = r;
					r = bigger % smaller;
				}
				gcd = Math.min( gcd, smaller );
			}
		}
		catch( Exception e )
		{
			return new PtgErr( PtgErr.ERROR_VALUE );
		}

		PtgNumber pnum = new PtgNumber( gcd );
		return pnum;
	}