summaryrefslogtreecommitdiffstats
path: root/bullet_loan.c
diff options
context:
space:
mode:
authorgonzo <gonzo@toniatuh.com>2026-09-05 11:11:35 +0200
committergonzo <gonzo@toniatuh.com>2026-09-05 11:11:35 +0200
commit0a3cab28ce353e9cf0caa8b202e433a0404a82e1 (patch)
tree26c15b8f18771e8a911460bab5711d8b0ddd376b /bullet_loan.c
parent93658108c0951e8b03cdd574ec436c1acb821c7b (diff)
downloadloan_calc-0a3cab28ce353e9cf0caa8b202e433a0404a82e1.tar.gz
clang-format + format all c filesHEADmaster
Diffstat (limited to 'bullet_loan.c')
-rw-r--r--bullet_loan.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/bullet_loan.c b/bullet_loan.c
index 8ec4be6..452885b 100644
--- a/bullet_loan.c
+++ b/bullet_loan.c
@@ -1,8 +1,10 @@
#include "loans.h"
contract *bullet_init(int n, int d, double r, double P) {
- if ((n < 0)) return NULL;
- if ((d >= n)||(d < 0)) return NULL;
+ if ((n < 0))
+ return NULL;
+ if ((d >= n) || (d < 0))
+ return NULL;
contract *c = (contract *)calloc(1, sizeof(contract));
c->n = (unsigned int)n;
c->d = (unsigned int)d;
@@ -24,12 +26,12 @@ double bullet_update(contract *c) {
c->P = 0.0;
}
- if (c->k <= c->d) c->P += c->I;
- else c->A = c->D + c->I;
+ if (c->k <= c->d)
+ c->P += c->I;
+ else
+ c->A = c->D + c->I;
return c->A;
}
-void bullet_free(contract *c) {
- free(c);
-}
+void bullet_free(contract *c) { free(c); }