aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/gnumeric/files/patch-plugins_fn-financial_functions.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/math/gnumeric/files/patch-plugins_fn-financial_functions.c b/math/gnumeric/files/patch-plugins_fn-financial_functions.c
new file mode 100644
index 000000000000..06a43b84db72
--- /dev/null
+++ b/math/gnumeric/files/patch-plugins_fn-financial_functions.c
@@ -0,0 +1,35 @@
+--- plugins/fn-financial/functions.c- Mon Feb 6 13:36:33 2006
++++ plugins/fn-financial/functions.c Mon Feb 6 13:38:17 2006
+@@ -1736,13 +1736,14 @@
+ gnm_float pmt = value_get_as_float (argv[2]);
+ gnm_float fv = argv[3] ? value_get_as_float (argv[3]) : 0;
+ int type = value_get_paytype (argv[4]);
++ gnm_float pvif, fvifa;
+
+ if (!is_valid_paytype (type))
+ return value_new_error_VALUE (ei->pos);
+
+ /* Calculate the PVIF and FVIFA */
+- gnm_float pvif = calculate_pvif (rate, nper);
+- gnm_float fvifa = calculate_fvifa (rate, nper);
++ pvif = calculate_pvif (rate, nper);
++ fvifa = calculate_fvifa (rate, nper);
+
+ if (pvif == 0)
+ return value_new_error_DIV0 (ei->pos);
+@@ -2007,12 +2008,13 @@
+ gnm_float pmt = value_get_as_float (argv[2]);
+ gnm_float pv = argv[3] ? value_get_as_float (argv[3]) : 0.;
+ int type = value_get_paytype (argv[4]);
++ gnm_float pvif, fvifa;
+
+ if (!is_valid_paytype (type))
+ return value_new_error_VALUE (ei->pos);
+
+- gnm_float pvif = calculate_pvif (rate, nper);
+- gnm_float fvifa = calculate_fvifa (rate, nper);
++ pvif = calculate_pvif (rate, nper);
++ fvifa = calculate_fvifa (rate, nper);
+
+ return value_new_float (-((pv * pvif) + pmt *
+ (1.0 + rate * type) * fvifa));