Some amount of tokens Copied from token-swap, for packing instruction buffer correctly
absolute value
addition
and
and (NOTE: andln is going to be replaced with andn in future)
andln
andn
add 1 << b to the number
1 << b
get number of bits occupied
return number of bytes occupied
clone number
compare numbers and return -1 (a < b), 0 (a == b), or 1 (a > b) depending on the comparison result
-1 (a < b)
0 (a == b)
1 (a > b)
divide
rounded division
Extended GCD results ({ a: ..., b: ..., gcd: ... })
({ a: ..., b: ..., gcd: ... })
a equals b
convert from two's complement representation, where width is the bit width
GCD
a greater than b
a greater than or equals b
clear bits with indexes higher or equal to b
b
multiply
negate sign
not (for the width specified by w)
w
inverse a modulo b
a
or
check if value is even
true if the number is negative
check if value is odd
check if value is zero
shift left
shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086)
square
subtraction
shift right
xor
a less than b
a less than or equals b
reduct
API consistency https://github.com/indutny/bn.js/pull/130
raise a to the power of b
set specified bit to 1
test if specified bit is set
convert to byte Array, and optionally zero pad to length, throwing if already exceeding
convert to an instance of type, which must behave like an Array
type
Convert to Buffer representation
convert to JSON compatible hex string (alias of toString(16))
convert to Javascript Number (limited to 53 bits)
Convert number to red
convert to base-string and pad with zeroes
convert to two's complement representation, where width is bit width
return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits)
Construct a Numberu64 from Buffer representation
returns true if the supplied object is a BN.js instance
returns the maximum of 2 BN instances.
returns the minimum of 2 BN instances.
create a reduction context with the Montgomery trick.
create a reduction context
Generated using TypeDoc
Some amount of tokens Copied from token-swap, for packing instruction buffer correctly