summaryrefslogtreecommitdiffstats
path: root/bullet_loan.c
diff options
context:
space:
mode:
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); }