No description
Find a file
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
.claude/commands Add /teach-me command encoding the feature workflow 2026-08-03 19:27:21 +02:00
crates Reject loan offers that can never amortise 2026-08-25 11:40:35 +02:00
scripts Add reference amortisation generator for known-answer tests 2026-08-18 18:07:23 +02:00
.gitignore Add reference amortisation generator for known-answer tests 2026-08-18 18:07:23 +02:00
Cargo.lock Add LoanOffer with validating constructor 2026-07-30 15:09:49 +02:00
Cargo.toml Set up cargo workspace backbone 2026-07-29 20:30:55 +02:00
CLAUDE.md Add LoanOffer::monthly_repayment 2026-08-23 16:26:55 +02:00
rust-toolchain.toml Set up cargo workspace backbone 2026-07-29 20:30:55 +02:00