[Freeciv-Dev] Re: server/settlers.c cleanup 3
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, 14 Apr 2002, Ross W. Wetmore wrote:
> >Thanks for pointing this out. I didn't know. But the solution seems
> >simple: cap input values at reasonable values.
>
> No! Convert the entire routine to run in floating point, and check the
> output values before storing them back into a return int. Complete
> isolation of the FP part is the only valid solution, unless you want
> to test every store operation in the routine for correctness.
We're talking about three lines of code here. Can you please show me, in
terms of C code, what needs to be done?
> The time savings are negligible, but more man hours have been spent
> fighting the amortize function battle than any other piece of code
> - I think this is the 4th or 5th round I know about.
So please help getting it right so that this discussion can end.
> Amortize should be replaced anyway ... it is really an unnecessary
> weighting function, the accuracy is totally irrelevant and the
> devloper time savings for better things would be a significant
> fraction of the ongoing effort.
>
> A good way to handle weighting functions is to make all your input
> calculations run in a fixed range, then pass the final result through
> an array lookup where the array is pre-computed for the set of values
> and that particular weighting function.
I don't understand. Can you please try to explain this in terms of some
pseudocode?
Yours,
Per
"Treason doth never prosper: what's the reason?
Why, if it prosper, none dare call it treason."
-- Sir John Harrington (1561-1612)
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, (continued)
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Raimar Falke, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Per I Mathisen, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Mike Kaufman, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Raimar Falke, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Ross W. Wetmore, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Per I Mathisen, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Mike Kaufman, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Raimar Falke, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Per I Mathisen, 2002/04/14
- Message not available
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Ross W. Wetmore, 2002/04/14
- [Freeciv-Dev] Re: server/settlers.c cleanup 3,
Per I Mathisen <=
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Markus Linnala, 2002/04/16
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Gregory Berkolaiko, 2002/04/16
- Message not available
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Ross W. Wetmore, 2002/04/16
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Gregory Berkolaiko, 2002/04/15
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Raahul Kumar, 2002/04/16
- [Freeciv-Dev] Re: server/settlers.c cleanup 3, Ross W. Wetmore, 2002/04/16
[Freeciv-Dev] Re: server/settlers.c cleanup 2, Gregory Berkolaiko, 2002/04/15
|
|