Ah right, that's correct. LGTM!


On Tue, Apr 22, 2014 at 5:27 PM, Julien Le Dem <notifications@github.com>wrote:

> In algebird-core/src/main/scala/com/twitter/algebird/Statistics.scala:
>
> > +/**
> > + * @author Julien Le Dem
> > + */
> > +
> > +/**
> > + * internal collection of a distribution of values on a log scale
> > + */
> > +private class Statistics {
> > +  import scala.math.{pow, min}
> > +  val maxPow = 10
> > +  var distribution: Array[Long] = new Array(maxPow + 1)
> > +  var total: Float = 0
> > +
> > +  def put(v: Int) {
> > +    total += v
> > +    val log2 = 32 - Integer.numberOfLeadingZeros(v);
>
> That is correct, however in this case it is possible for v to be 0.
> "log2" as the name of the variable is inexact but the value is actually
> what I want to store it in the array.
> It is more "log2_of_v_plus_1" but I could also call it "bucket"
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/twitter/algebird/pull/311/files#r11882686>
> .
>