Freeciv-3.3
Loading...
Searching...
No Matches
advtools.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <math.h>
19
20#include "advtools.h"
21
22/**********************************************************************/
30{
31 double discount = 1.0 - 1.0 / ((double)MORT);
32
33 /* Note there's no rounding here. We could round but it would probably
34 * be better just to return (and take) a double for the benefit. */
35 return benefit * pow(discount, delay);
36}
adv_want amortize(adv_want benefit, int delay)
Definition advtools.c:29
#define MORT
Definition advtools.h:19
char * incite_cost
Definition comments.c:76
float adv_want
Definition fc_types.h:1063