Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qu.ai/llms.txt

Use this file to discover all available pages before exploring further.

function fromTwos(_value, _width): bigint
Convert value from a twos-compliment representation of width bits to its value. If the highest bit is 1, the result will be negative.

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:42