Hacker News new | ask | show | jobs
by 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.
1 comments

So dividing by number of months, which is not dividing by an amount of money.
var balance = 0

var lastPayment = 0

var remainingPaymentsAtThisRate = balance/lastPayment

// divide by zero error

Surely that doesn't account for interest?
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.