Code example for BigInteger

Methods: add

0
 
    public static final PyObject newSigned64(long value) {
        return Py.newInteger(value);
    } 
 
    private static final BigInteger UINT64_BASE = BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.ONE);
    public static final PyObject newUnsigned64(long value) {
        return value < 0
                    ? Py.newLong(BigInteger.valueOf(value & 0x7fffffffffffffffL).add(UINT64_BASE))
                    : Py.newInteger(value);
    } 
 
    public static final PyObject newString(long address) {
        return address != 0
                    ? Py.newString(new String(IO.getZeroTerminatedByteArray(address)))
                    : Py.None; 
    } 
 
    public static final byte int8Value(PyObject parameter) {
        return (byte) intValue(parameter);
    }