FA-63182 / Insurance premium rating / Member archive
Calendar period earned and unearned premium: Earned premium is rounded per policy · case 02
Portfolio earned premium differs by cents from the exact total.
Case contract
Input period [start, end) in days and policies [[written day, term days (>0 else 'invalid term'), premium]]. Earned = premium*overlap/term where overlap = max(0, min(end, w+term) - max(start, w)). Unearned at end counts policies written before end and still in force after it. Sum exactly; round each total half-up once.
Why this case matters
Earned premium is the denominator of every loss ratio, so exposure-overlap slips distort rate indications.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| odd premiums | [146760, 3622] | [146759, 3622] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗