bitLength property

  1. @override
int bitLength
override

Returns the minimum number of bits required to store this integer.

The number of bits excludes the sign bit, which gives the natural length for non-negative (unsigned) values. Negative values are complemented to return the bit position of the first bit that differs from the sign bit.

To find the the number of bits needed to store the value as a signed value, add one, i.e. use x.bitLength + 1.

Implementation

@override
int get bitLength => _i.bitLength;