Y
Hacker News
new
|
ask
|
show
|
jobs
by
thomasahle
2575 days ago
I'm having a hard me thinking of a case where you'd want to divide by an amount of money. What am I missing?
2 comments
Ma8ee
2575 days ago
For example to calculate the expected time left to pay the remaining debt if you make a monthly payment of that amount.
link
delinka
2575 days ago
So dividing by number of months, which is not dividing by an amount of money.
link
vollmond
2575 days ago
var balance = 0
var lastPayment = 0
var remainingPaymentsAtThisRate = balance/lastPayment
// divide by zero error
link
cbzoiav
2574 days ago
Surely that doesn't account for interest?
link
vollmond
2574 days ago
My goal with this 3-line pseudocode snippet was not to reproduce a banking loan administration system in its entirety, but just to show a place where it could make sense to divide by currency.
link
red75prime
2575 days ago
Or to produce a report on percent of debt that has been repaid.
link