注意: このページはまだ日本語に翻訳されていません。以下は英語の原文です。
function toTwos(_value, _width): bigint
Convert value to a twos-compliment representation of width bits. The result will always be positive.

Parameters

ParameterTypeDescription
_valueBigNumberishThe value to convert.
_widthNumericThe width of the value in bits.

Returns

bigint The value.

Throws

If the value is too large for the width.

Source

utils/maths.ts:72