@@ -0,0 +1,1565 @@
+package org.psjava.math.ns;%0D%0A%0D%0Apublic class LongNumberSystem implements IntegerDivisableNumberSystem%3CLong%3E %7B%0D%0A%0D%0A%09private static final LongNumberSystem INSTANCE = new LongNumberSystem();%0D%0A%0D%0A%09public static LongNumberSystem getInstance() %7B%0D%0A%09%09return INSTANCE;%0D%0A%09%7D%0D%0A%0D%0A%09private LongNumberSystem() %7B%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public Long getZero() %7B%0D%0A%09%09return 0L;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public boolean isPositive(Long v) %7B%0D%0A%09%09return v %3E 0;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public boolean isZero(Long v) %7B%0D%0A%09%09return v == 0;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public boolean isNegative(Long v) %7B%0D%0A%09%09return v %3C 0;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public int getSign(Long v) %7B%0D%0A%09%09return Long.signum(v);%0D%0A%09%7D%0D%0A%09%0D%0A%09@Override%0D%0A%09public boolean areEqual(Long o1, Long o2) %7B%0D%0A%09%09return o1.equals(o2);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public Long getOne() %7B%0D%0A%09%09return Long.valueOf(1);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public boolean isOne(Long v) %7B%0D%0A%09%09return v == 1;%0D%0A%09%7D%0D%0A%09%0D%0A%09@Override%0D%0A%09public Long add(Long v1, Long v2) %7B%0D%0A%09%09return GuavasLongMath.checkedAdd(v1, v2);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public Long subtract(Long minuend, Long subtrahend) %7B%0D%0A%09%09return GuavasLongMath.checkedSubtract(minuend, subtrahend);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public Long multiply(Long v1, Long v2) %7B%0D%0A%09%09return GuavasLongMath.checkedMultiply(v1, v2);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public Long integerDivide(Long dividend, Long divisor) %7B%0D%0A%09%09return Long.valueOf(dividend / divisor);%0D%0A%09%7D%0D%0A%09%0D%0A%09@Override%0D%0A%09public Long integerRemainder(Long dividend, Long divisor) %7B%0D%0A%09%09return Long.valueOf(dividend %25 divisor);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public int compare(Long o1, Long o2) %7B%0D%0A%09%09return o1.compareTo(o2);%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add long number system