toSignedBinaryFixedPoint
Converts a BinaryFixedPoint to its signed equivalent at the same
totalBits and fractionalBits.
Signed inputs are returned by reference unchanged; unsigned inputs are
accepted as long as their raw value fits the signed range, i.e.
raw <= 2 ** (totalBits - 1) - 1.
Throws SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE when the input's
raw value exceeds the maximum representable signed value at its
totalBits.
Type Parameters
| Type Parameter |
|---|
TTotalBits extends number |
TFractionalBits extends number |
Parameters
| Parameter | Type |
|---|---|
value | BinaryFixedPoint<Signedness, TTotalBits, TFractionalBits> |
Returns
BinaryFixedPoint<"signed", TTotalBits, TFractionalBits>