Example #1
0
  public static void testMult() {
    LongInteger li1, li2;

    li1 = new LongInteger("-199999999");
    li2 = new LongInteger("100000000");

    li1.multiply(li2).output();
  }
Example #2
0
  public static void testSub() {
    LongInteger li1, li2;

    li1 = new LongInteger("-1");
    li2 = new LongInteger("100000000");

    li1.subtract(li1).output();
  }
Example #3
0
  public static void testAdd() {
    LongInteger li1, li2;

    li1 = new LongInteger("1000000");
    //		li1 = new LongInteger("99999999");
    li2 = new LongInteger("-1");

    li1.add(li2).output();
  }
Example #4
0
  public static void testLongInteger(String greater, String less) {
    LongInteger lig = new LongInteger(greater);
    LongInteger lil = new LongInteger(less);

    System.out.println(greater);
    lig.output();

    System.out.println("isNegative: " + lig.getSign());
    System.out.println(greater.length() + "\n" + lig.getDigitCount());
    System.out.println(!lig.equalTo(lil));
    System.out.println(!lig.lessThan(lil));
    System.out.println(lig.greaterThan(lil));
  }
Example #5
0
 public static void testKarat() {
   System.out.println(arrToStr(LongInteger.singleKarat(99999999, 99999999)));
 }