summaryrefslogtreecommitdiffstats
path: root/contract.h
diff options
context:
space:
mode:
authorgonzo <gonzo@toniatuh.com>2023-05-19 22:28:10 +0200
committergonzo <gonzo@toniatuh.com>2023-05-19 22:28:10 +0200
commit2c380f8df666fcebd979511f33e7d72291b389cd (patch)
tree0238209fa73cfa7e4c0a8a58b3ffd8426c20db60 /contract.h
parent0751b55f611b889f63dfc2bc2705e7537703cb43 (diff)
downloadloan_calc-2c380f8df666fcebd979511f33e7d72291b389cd.tar.gz
moved from floats to doubles for added precision
Diffstat (limited to 'contract.h')
-rw-r--r--contract.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/contract.h b/contract.h
index 4c74cb0..bcaef15 100644
--- a/contract.h
+++ b/contract.h
@@ -1,12 +1,15 @@
#pragma once
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
typedef struct contract {
unsigned int n; /* duration of the loan */
unsigned int k; /* current year */
unsigned int d; /* delay period of the loan */
- float r; /* interest rate */
- float P; /* part of the pricipal left at year k */
- float I; /* the interest for year k */
- float D; /* part of the capital reinbursed on year k */
- float A; /* annuity for year k */
+ double r; /* interest rate */
+ double P; /* part of the pricipal left at year k */
+ double I; /* the interest for year k */
+ double D; /* part of the capital reinbursed on year k */
+ double A; /* annuity for year k */
} contract;
+#pragma clang diagnostic pop