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.
__init__(self: pybiginteger.BigInteger, value: int) -> None
__init__(self: pybiginteger.BigInteger, value: buffer) -> None
-
static
log
(*args, **kwargs)¶ Overloaded function.
-
static
log10
(*args, **kwargs)¶ Overloaded function.
log10(value: pybiginteger.BigInteger) -> float
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
¶