protected static Ptg calcLCM( Ptg[] operands )
	{
		if( operands.length < 1 )
		{
			return new PtgErr( PtgErr.ERROR_NA );
		}
		Ptg[] numbers = PtgCalculator.getAllComponents( operands );
		// algorithm:
		// LCM(a, b)= (a*b)/GCD(a, b)
		long lcm = 0;
		try
		{
			Ptg[] ops = new Ptg[2];
			if( (lcm = PtgCalculator.getLongValue( numbers[0] )) < 0 )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}

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

				ops[0] = new PtgNumber( lcm );
				ops[1] = new PtgNumber( n2 );
				long gcd = PtgCalculator.getLongValue( calcGCD( ops ) );
				lcm = (lcm * n2) / gcd;
			}
		}
		catch( Exception e )
		{
			return new PtgErr( PtgErr.ERROR_VALUE );
		}

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