Yeah, I'm not overly concerned about the overflow, especially if you make v
a Long and total a double.


On Tue, Apr 22, 2014 at 5:23 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
>
> This should add up to the total number of values summed in a given context.
> In a hadoop job for example this should not be an issue.
> Possibly in the context of a forever running storm job there should be a
> way to reset the stats every fixed period of time?
> I can add a reset method to enable this.
> It would still take a very long time to overflow.
> If I make v a Long and total a double it would become practically
> impossible to overflow.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/twitter/algebird/pull/311/files#r11882588>
> .
>