BitLength
BitLength(x)
gives the number of bits needed to represent the integer
x
. The sign ofx
is ignored.
Examples
>> BitLength(1023)10
>> BitLength(100)7
>> BitLength(-5)3
>> BitLength(0)0
Implementation status
- ✅ - full supported
BitLength(x)
gives the number of bits needed to represent the integer
x
. The sign ofx
is ignored.
>> BitLength(1023)10
>> BitLength(100)7
>> BitLength(-5)3
>> BitLength(0)0