biginteger — A C# like BigInteger implementation

While Python natively supports infinite numbers through its build in int type, the BigInteger class of the C# reference implementation exhibits different behaviour in certain areas. By using this class we can prevent any discrepancies in price calculations, virtual machine execution path and more.

In particular the following differences in behaviour can be expected when using this class.

  • Negative bitwise shifting is supported.

    • A negative left shift becomes a positive right shift.

    • A negative right shift becomes a positive left shift.

  • Increased modulo rounding precision.

  • Use modulo truncated division instead of floored division.

  • Serialization of negative numbers can in certain cases return an extra byte.

  • Integer division instead of floating point division.

class neo3.vm.BigInteger(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

Overloaded function.

  1. __init__(self: pybiginteger.BigInteger, value: int) -> None

  2. __init__(self: pybiginteger.BigInteger, value: buffer) -> None

is_even(self: pybiginteger.BigInteger)bool
is_power_of_two(self: pybiginteger.BigInteger)bool
static log(*args, **kwargs)

Overloaded function.

  1. log(value: pybiginteger.BigInteger) -> float

  2. log(value: int) -> float

  3. log(value: pybiginteger.BigInteger, base_value: float) -> float

  4. log(value: int, base_value: float) -> float

static log10(*args, **kwargs)

Overloaded function.

  1. log10(value: pybiginteger.BigInteger) -> float

  2. log10(value: int) -> float

static minus_one()pybiginteger.BigInteger
static one()pybiginteger.BigInteger
to_array(self: pybiginteger.BigInteger, is_unsigned: bool = False, is_bigendian: bool = False)bytes

Return the value of the BigInteger. For more information on the options see: https://docs.microsoft.com/en-us/dotnet/api/system.numerics.biginteger.tobytearray?view=netcore-3.1#System_Numerics_BigInteger_ToByteArray_System_Boolean_System_Boolean_

static zero()pybiginteger.BigInteger
property sign