ofBigInt static method

LogicValue ofBigInt(
  1. BigInt value,
  2. int width, {
  3. bool allowTruncation = false,
})

Converts BigInt value to a valid LogicValue with width number of bits.

width must be greater than or equal to 0.

Implementation

static LogicValue ofBigInt(
  BigInt value,
  int width, {
  bool allowTruncation = false,
}) {
  _warnOnIntegerTruncation(value, width, allowTruncation);
  return width > INT_BITS
      ? _bigLogicValueOrFilled(value, BigInt.zero, width)
      : _smallLogicValueOrFilled(value.toIntUnsigned(width), 0, width);
}