negateBinaryFixedPoint

function negateBinaryFixedPoint<TTotalBits, TFractionalBits>(
    a,
): BinaryFixedPoint<'signed', TTotalBits, TFractionalBits>;

Returns the additive inverse of a signed BinaryFixedPoint.

Unsigned values are rejected at the type level; they are also rejected at runtime with SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH in case the type safety is bypassed. Negating the minimum representable value overflows and throws SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW.

Type Parameters

Type Parameter
TTotalBits extends number
TFractionalBits extends number

Parameters

ParameterType
aBinaryFixedPoint<"signed", TTotalBits, TFractionalBits>

Returns

BinaryFixedPoint<"signed", TTotalBits, TFractionalBits>

See

absoluteBinaryFixedPoint

On this page