// Path: engine/jprol-core/src/main/java/com/igormaznitsa/jprol/data/Terms.java
// public static TermLong newLong(final String text) {
//   return new TermLong(text);
// }


import static com.igormaznitsa.jprol.data.Terms.newLong;
  @Override
  public Number toNumber() {
    return this.value;
  }

  @Override
  public String toSrcString() {
    return Long.toString(value);
  }

  @Override
  public String getText() {
    return Long.toString(this.value);
  }

  @Override
  public int compare(final NumericTerm atom) {
    if (atom.isDouble()) {
      final double value = atom.toNumber().doubleValue();
      return Double.compare((double) this.value, value);
    }
    return Long.compare(this.value, atom.toNumber().longValue());
  }

  @Override
  public NumericTerm add(final NumericTerm atom) {
    if (atom.isDouble()) {
      final double value = atom.toNumber().doubleValue();
      return Terms.newDouble((double) this.value + value);
    } else {
// Path: engine/jprol-core/src/main/java/com/igormaznitsa/jprol/data/Terms.java
// public static TermLong newLong(final String text) {
//   return new TermLong(text);
// }


// Path: engine/jprol-core/src/main/java/com/igormaznitsa/jprol/data/TermLong.java
import static com.igormaznitsa.jprol.data.Terms.newLong;

  @Override
  public Number toNumber() {
    return this.value;
  }

  @Override
  public String toSrcString() {
    return Long.toString(value);
  }

  @Override
  public String getText() {
    return Long.toString(this.value);
  }

  @Override
  public int compare(final NumericTerm atom) {
    if (atom.isDouble()) {
      final double value = atom.toNumber().doubleValue();
      return Double.compare((double) this.value, value);
    }
    return Long.compare(this.value, atom.toNumber().longValue());
  }

  @Override
  public NumericTerm add(final NumericTerm atom) {
    if (atom.isDouble()) {
      final double value = atom.toNumber().doubleValue();
      return Terms.newDouble((double) this.value + value);
    } else {
      return newLong(this.value + atom.toNumber().longValue());