should-i-rent/crates
Marcel Enguehard f1ba015cc3 Reject loan offers that can never amortise
At high rate and long duration the rounded instalment converges to C*i from
above and lands exactly on the first month's interest, leaving zero principal:
at 99 % the frontier is 294 months for the maximum capital. The schedule would
never terminate.

Checking the first month suffices: once principal is positive the outstanding
capital decreases, so interest decreases and principal grows. The check must
stay after the bounds checks, since it calls monthly_repayment() and that
function's expect() is justified by them.

creating_loan_offer_with_limit_inputs_works asserted that the three maxima
combined were valid, which this invariant makes false. The valid domain is no
longer a box. It is replaced by the corner that actually maximises the
instalment, duration 1, at 1 082 499 999,99 EUR against 82 500 000,00 EUR for
the corner it tested before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 11:40:35 +02:00
..
immo-core Reject loan offers that can never amortise 2026-08-25 11:40:35 +02:00
immo-web Set up cargo workspace backbone 2026-07-29 20:30:55 +02:00