LCM.java :  » Algebra » symja » org » matheclipse » core » reflection » system » Java Open Source

Java Open Source » Algebra » symja 
symja » org » matheclipse » core » reflection » system » LCM.java
package org.matheclipse.core.reflection.system;

import org.matheclipse.core.eval.interfaces.AbstractArgMultiple;
import org.matheclipse.core.interfaces.IExpr;
import org.matheclipse.core.interfaces.IInteger;
import org.matheclipse.core.interfaces.ISymbol;

/**
 * Least common multiple
 * 
 * See <a href="http://en.wikipedia.org/wiki/Least_common_multiple">Wikipedia:Least common multiple</a>
 */
public class LCM extends AbstractArgMultiple {
  /**
   * Constructor for the LCM object
   */
  public LCM() {
  }

  /**
   * Compute lcm of 2 integer numbers
   *
   */
  @Override
  public IExpr e2IntArg(final IInteger i0, final IInteger i1) {
    return i0.lcm(i1);
  }

  @Override
  public void setUp(final ISymbol symbol) {
    symbol.setAttributes(ISymbol.ONEIDENTITY | ISymbol.ORDERLESS | ISymbol.FLAT | ISymbol.LISTABLE);
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.