absoluteDecimalFixedPoint

function absoluteDecimalFixedPoint<TSignedness, TTotalBits, TDecimals>(
    a,
): DecimalFixedPoint<TSignedness, TTotalBits, TDecimals>;

Returns the absolute value of a DecimalFixedPoint. Unsigned inputs are returned unchanged.

Throws SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW when taking the absolute value of the minimum representable signed value, which has no positive counterpart in two's-complement.

Type Parameters

Type Parameter
TSignedness extends Signedness
TTotalBits extends number
TDecimals extends number

Parameters

ParameterType
aDecimalFixedPoint<TSignedness, TTotalBits, TDecimals>

Returns

DecimalFixedPoint<TSignedness, TTotalBits, TDecimals>

See

negateDecimalFixedPoint

On this page