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!
> 
> 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
> 
> 

Attachment: pgpBRoKDeJW7O.pgp
Description: PGP signature

_______________________________________________
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to