toUnsignedBinaryFixedPoint function

BinaryFixedPoint toUnsignedBinaryFixedPoint(
  1. BinaryFixedPoint value
)

Converts value to an unsigned binary fixed-point value with the same raw value, total bit width, and fractional bit count.

Implementation

BinaryFixedPoint toUnsignedBinaryFixedPoint(BinaryFixedPoint value) {
  if (value.signedness == FixedPointSignedness.unsigned) return value;
  return rawBinaryFixedPoint(
    FixedPointSignedness.unsigned,
    value.totalBits,
    value.fractionalBits,
  )(value.raw);
}