Flexibel Hier mal die angepassten Preise auf Basis des RAM-Ausbaus von 1986. Erst ein kleines C-Programm das ich unter DOS geschrieben habe (lässt sich auch auf dem Raspi problemlos übersetzen) um die 400 DM an den heutigen Wert anzupassen:
C
/*
* Inflation adjust a given amount of money from given year for Germany.
*
* Amounts given for years after 2002 must be given in EUR.
*
* The amount is automatically converted from Mark to EUR when neccessary.
*
* The adjustment factor for each year is taken from the _Inflation_ template on
* german Wikipedia:
*
* https://de.wikipedia.org/w/index.php?title=Vorlage:Inflation/DE&action=raw
*
* DOS & Watcom C: wcl -mt -fpc -oxhtsl+ infadj.c
*/
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#define START_YEAR 1882
#define END_YEAR 2025
#define DM_TO_EUR_YEAR 2002
static double factors[] = {
/* 1882 */ 0.986, 1.014, 0.973, 1.028, 1.014, 1, 1, 1.04,
/* 1890 */ 1.026, 1.013, 1, 0.963, 0.987, 0.987, 0.987, 1.013, 1.039, 0.987,
/* 1900 */ 1, 1.013, 1.013, 1, 1.013, 1.049, 1.035, 1.011, 1.011, 1.022,
/* 1910 */ 1.011, 1.032, 1.063, 0.98, 1, 1.35, 1.333, 1.25, 1.378, 1.581,
/* 1920 */ 2.131, 1.281, 1, 1, 0.0978, 1.084, 1.002, 1.041, 1.026, 1.015,
/* 1930 */ 0.962, 0.919, 0.886, 0.978, 1.026, 1.016, 1.012, 1.005, 1.004, 1.005,
/* 1940 */ 1.031, 1.024, 1.026, 1.014, 1.021, 1.023, 1.092, 1.069, 1.2513, 0.989,
/* 1950 */ 0.936, 1.076, 1.021, 0.983, 1.004, 1.014, 1.028, 1.02, 1.023, 1.006,
/* 1960 */ 1.016, 1.025, 1.028, 1.03, 1.024, 1.032, 1.033, 1.019, 1.016, 1.018,
/* 1970 */ 1.036, 1.052, 1.054, 1.071, 1.069, 1.06, 1.042, 1.037, 1.027, 1.041,
/* 1980 */ 1.054, 1.063, 1.052, 1.032, 1.025, 1.02, 0.999, 1.002, 1.012, 1.028,
/* 1990 */ 1.026, 1.037, 1.05, 1.045, 1.026, 1.018, 1.013, 1.02, 1.009, 1.006,
/* 2000 */ 1.014, 1.02, 1.013, 1.011, 1.017, 1.015, 1.016, 1.023, 1.026, 1.003,
/* 2010 */ 1.011, 1.021, 1.02, 1.014, 1.01, 1.005, 1.005, 1.015, 1.018, 1.014,
/* 2020 */ 1.005, 1.031, 1.069, 1.059, 1.022, 1.022
};
int main(int argc, char **argv)
{
uint16_t start_year, year;
double amount, result;
char *start_currency, *result_currency;
char *end_ptr;
unsigned long int value;
if (argc < 3) {
printf("Usage: %s YEAR AMOUNT\n", argv[0]);
return 1;
}
value = strtoul(argv[1], &end_ptr, 10);
if (*end_ptr != '\0') {
printf("Can not parse '%s' as year. Unexpected '%c'.\n", argv[1], *end_ptr);
return 2;
}
if (! (START_YEAR <= value && value <= END_YEAR)) {
printf("Year %lu not in range %u to %u.\n", value, START_YEAR, END_YEAR);
return 2;
}
start_year = value;
start_currency = result_currency = (start_year < DM_TO_EUR_YEAR) ? "Mark" : "EUR";
amount = strtod(argv[2], &end_ptr);
if (*end_ptr != '\0') {
printf("Can not parse '%s' as amount. Unexpected '%c'.\n", argv[2], *end_ptr);
return 3;
}
for (year = start_year, result = amount; year <= END_YEAR; ++year) {
result *= factors[year - START_YEAR];
if (year == 2002) {
result /= 1.95583;
result_currency = "EUR";
}
}
printf("%.2f %s in %"PRIu16" = %.2f %s in %"PRIu16".\n",
amount, start_currency, start_year, result, result_currency, year);
return 0;
}
Display More
Schauen wir mal was die 400 DM heute in € sind:
Und dann die Hoch- beziehungsweise Umrechnung auf verschiedene Speichergrössen auf einem ZX Spectrum:
Code
10 LET price per kb=445.33/384: LET u$="KMG"
20 READ size,magnitude: IF size=0 THEN STOP
30 LET price=size*1024↑magnitude*price per kb
40 PRINT size;TAB 4;u$(magnitude+1);"iB = ";INT (price*100+.5)/100;" EUR"
50 GO TO 20
60 DATA 1,0,48-16,0,384,0,1,1,1,2,2,2,4,2,8,2,16,2,32,2,0,0
Ergebnis:
Code
1 KiB = 1.16 EUR
32 KiB = 37.11 EUR
384 KiB = 445.33 EUR
1 MiB = 1187.55 EUR
1 GiB = 1216047.8 EUR
2 GiB = 2432095.6 EUR
4 GiB = 4864191.2 EUR
8 GiB = 9728382.3 EUR
16 GiB = 19456765 EUR
32 GiB = 38913529 EUR
Es hätte also nur 37,11 € gekostet einen ZX Spectrum mit 16 KiB auf die vollen 48 KiB aufzurüsten. Aber Du musstest ja unbedingt einen PC verwenden. ![]()