HdrHistogram.HistogramBase.SizeOfEquivalentValueRange C# (CSharp) Method

SizeOfEquivalentValueRange() public method

Get the size (in value units) of the range of values that are equivalent to the given value within the histogram's resolution. Where "equivalent" means that value samples recorded for any two equivalent values are counted in a common total count.
public SizeOfEquivalentValueRange ( long value ) : long
value long The given value
return long
        public long SizeOfEquivalentValueRange(long value)
        {
            var bucketIndex = GetBucketIndex(value);
            var subBucketIndex = GetSubBucketIndex(value, bucketIndex);
            if (subBucketIndex >= SubBucketCount)
            {
                //TODO: Validate the conditions under which this is hit. Missing unit test (just copy from Java) -LC
                bucketIndex++;
            }
                
            var distanceToNextValue = 1 << (_unitMagnitude + bucketIndex);
            return distanceToNextValue;
        }