toInt method

int toInt()

Only safe if the value fits in 53 bits (i.e. hi <= 0x1FFFFF). Throws otherwise — use toBigInt for the general case.

Implementation

int toInt() {
  if (_hi > 0x1FFFFF) {
    throw IntegerError.toIntConvertionError;
  }
  return _hi * 0x100000000 + _lo;
}