Create a new instance, don't use this directly. Use the .from factory method instead.
The underlying BN.js instance – don't modify this
directly – take a copy first using .clone().
StaticabiStaticbyteStaticisNumber as bytes in little endian (matches memory layout in C++ contract).
StaticmaxLargest value that can be represented by this integer type.
StaticminSmallest value that can be represented by this integer type.
StaticzeroReturn a zero value of this type
Mutating add.
Non-mutating add.
Cast this integer to other type.
Optionaloverflow: OverflowBehavior
How to handle overflow, default is to preserve bit-pattern (C++11 behavior).
Mutating divide.
Optionalbehavior: DivisionBehavior
How to handle the remainder, default is to floor (round down).
Non-mutating divide.
Optionalbehavior: DivisionBehavior
How to handle the remainder, default is to floor (round down).
Compare two integers, if strict is set to true the test will only consider integers of the exact same type. I.e. Int64.from(1).equals(UInt64.from(1)) will return false.
Optionalstrict: booleanMutating multiply.
Non-mutating multiply.
Mutating subtract.
Non-mutating subtract.
Called when encoding to json abi format.
Returns a string representation of an object.
StaticabiStaticaddAdd lhs to rhs and return the resulting value.
Optionaloverflow: OverflowBehaviorStaticdivDivide lhs by rhs and return the quotient, dropping the remainder.
Optionaloverflow: OverflowBehaviorStaticdivDivide lhs by rhs and return the quotient + remainder rounded up to the closest integer.
Optionaloverflow: OverflowBehaviorStaticdivDivide lhs by rhs and return the quotient + remainder rounded to the closest integer.
Optionaloverflow: OverflowBehaviorStaticfromCreate a new instance from value.
Value to create new Int instance from, can be a string, number, little-endian byte array or another Int instance.
Optionaloverflow: OverflowBehavior
How to handle integer overflow, default behavior is to throw.
Create a new instance from value.
Value to create new Int instance from, can be a string, number, little-endian byte array or another Int instance.
Optionaloverflow: OverflowBehavior
How to handle integer overflow, default behavior is to throw.
StaticfromStaticgtStaticgteStaticltStaticlteStaticmulMultiply lhs by rhs and return the resulting value.
Optionaloverflow: OverflowBehaviorStaticrandomStaticsubAdd lhs to rhs and return the resulting value.
Optionaloverflow: OverflowBehavior
Binary integer with the underlying value represented by a BN.js instance. Follows C++11 standard for arithmetic operators and conversions.
Note
This type is optimized for correctness not speed, if you plan to manipulate integers in a tight loop you're advised to use the underlying BN.js value or convert to a JavaScript number first.