Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12833) consider_settler_action simplification (rev
Home

[Freeciv-Dev] Re: (PR#12833) consider_settler_action simplification (rev

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bdunstan149@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12833) consider_settler_action simplification (rev.)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Apr 2005 23:51:13 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12833 >

Brian Dunstan wrote:

> +    /* use factor to prevent rounding errors */
> +    total_value = amortize((1024* base_value), delay) / 1024;

The point of multiplying by 1024 is to avoid rounding errors.  Excepting
the bugginess of amortize, this doesn't help if you then divide by 1024.
 Often the delay will be reasonably large (20 turns) so with rounding
the amortized value could become too small to be useful for comparisons
after the divide.

And yes this nastiness could be avoided by using doubles.  I'm all in
favor of this but amortize has to be changed first.

-jason





[Prev in Thread] Current Thread [Next in Thread]