bitsRequired

fun bitsRequired(maxValue: Long): Int

Returns how many bits are required to hold values up to and including maxValue

Return

the amount of bits needed to represent values from 0 to maxValue.

Parameters

maxValue

the maximum value that should be representable.

See also