FA-59009 / Payroll withholding rules / Member archive
Overtime regular rate with bonuses and differentials: premium cent rounding · case 04
Overtime premiums ending in a half cent or more are a cent short.
Case contract
Input weekly {hours, rate, bonus, discretionary, diff_hours, diff}. Straight pay = hours*rate + diff_hours*diff. Regular rate = (straight pay + bonus unless discretionary) / hours. Overtime premium = regular rate * max(0, hours-40) / 2, rounded half-up to the cent. Total = straight pay + bonus + premium. Zero hours returns [0, bonus]. Return [premium, total].
Why this case matters
Nondiscretionary bonuses and shift differentials raise the regular rate, and only a half-time premium is owed on top of straight-time pay.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [10336, 122889] | [10337, 122890] | 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 ↗