Java :)
import java.math.BigInteger;
public class BigArithmetic {
public static void main(String[] args) { System.out.println(bigAdd(1, "123456789012345678901234567890")); System.out.println(bigAdd(-1, "123456789012345678901234567890")); System.out.println(bigSub("123456789012345678901234567890", 1)); System.out.println(bigSub("123456789012345678901234567890", -1)); } private static String bigSub(Object a, Object b) { return new BigInteger(a.toString()).add(new BigInteger(b.toString())).toString(); } private static String bigAdd(Object a, Object b) { return new BigInteger(a.toString()).add(new BigInteger(b.toString())).toString(); }
}
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Java :)
import java.math.BigInteger;
public class BigArithmetic {
}