toInt method

int toInt()

Convert to int, throwing an exception if out of range.

Implementation

int toInt() {
  final bi = toBigInt();
  if (bi < -BigInt.two.pow(width) || bi >= BigInt.two.pow(width)) {
    throw RohdHclException('SignMagnitudeValue.toInt: value $bi out of '
        'range for width $width');
  }
  return bi.toInt();
}