Skip to content

fixedUIntBigNeg

fixedUIntBigNeg(value, bitWidth, mode?): bigint

Defined in: packages/math-numbers/src/fixed-int-big/fixed-uint-big-neg.ts:18

Negation of a bitWidth-bit unsigned integer, under mode.

Every non-zero input overflows, since the unsigned range holds no negative value. That is not a degenerate case but the useful one: under wrap this is the two’s-complement negation hardware performs, so -x is 2 ** bitWidth - x and negating twice returns the original.

bigint

The value to negate.

number

Width of the integer, in bits.

OverflowMode

Overflow policy. Defaults to numericConfig.defaultOverflowMode.

bigint

When bitWidth is not a non-negative safe integer.

When value is non-zero and mode is abort.