On Tuesday 18 December 2007 15:27, Florent Daignière wrote:
> * Matthew Toseland <[EMAIL PROTECTED]> [2007-12-18 15:21:28]:
> 
> > On Monday 17 December 2007 00:39, [EMAIL PROTECTED] wrote:
> > > Author: nextgens
> > > Date: 2007-12-17 00:39:23 +0000 (Mon, 17 Dec 2007)
> > > New Revision: 16639
> > > 
> > > Modified:
> > >    
trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java
> > > Log:
> > > TimeDecayingRunningAverage: we were loosing in precision here (float => 
int)
> > 
> > No we're not, it's a long!
> 
> The commit message is wrong indeed, we were dividing a long by an int
> and casting it to a double.

The fix is okay though.
> 
> > > 
> > > Modified: 
> > trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java
> > > ===================================================================
> > > --- 
trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java  
> > 2007-12-17 00:24:38 UTC (rev 16638)
> > > +++ 
trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java  
> > 2007-12-17 00:39:23 UTC (rev 16639)
> > > @@ -184,7 +184,8 @@
> > >                                           
> > > timeSkewCallback.setTimeSkewDetectedUserAlert();
> > >                                   return;
> > >                           } else {
> > > -                                 if((uptime / 4) < thisHalfLife) 
> > > thisHalfLife = (uptime / 4);
> > > +                                 double oneFourthOfUptime = uptime / 4D;
> > > +                                 if(oneFourthOfUptime < thisHalfLife) 
> > > thisHalfLife = 
oneFourthOfUptime;
> > >                           }
> > >                           
> > >                           if(thisHalfLife == 0) thisHalfLife = 1;
> > > 
> > > _______________________________________________
> > > cvs mailing list
> > > [EMAIL PROTECTED]
> > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> > > 
> > > 
> 
> 
> 
> > _______________________________________________
> > Devl mailing list
> > [email protected]
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> 

Attachment: pgp80pRdXOTI8.pgp
Description: PGP signature

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to