[package]
[Java implementation]
[Execution output]
BigIntegers
import java.math.BigInteger;
import church.lang.Array;bigInteger(long: i) = BigInteger.valueOf(i);stream << (BigInteger: a) = stream << a.toString();(BigInteger: a) == (BigInteger: b) = a.equals(b);additive_identity = BigInteger.ZERO;
(BigInteger: a) + (BigInteger: b) = a.add(b);
-(BigInteger: a) = a.negate();
multiplicative_identity = BigInteger.ONE;
(BigInteger: a) * (BigInteger: b) = a.multiply(b);
(BigInteger: a) ^ (int: n) = a.pow(n);divide(BigInteger: a, BigInteger: b, f) = {qNr = a.divideAndRemainder(b); f(qNr[0], qNr[1])};
quotient(BigInteger: a, BigInteger: b) = a.divide(b);
(BigInteger: a) % (BigInteger: b) = a.remainder(b);compare(BigInteger: a, BigInteger: b) = {
c = a.compareTo(b);
if c < 0 then Ordering.LT else
if c > 0 then Ordering.GT else
Ordering.EQ;
};