FAILURE MAP
← Case archive

FA-85348 / Ride-hailing fare and surge pricing / Member archive

Distance charge truncated to the cent · case 03

Distance charges ending in half a cent or more lose a cent.

Member previewVariant 3 · 3 implementations · 7 checks per implementation

Case contract

All money is integer cents. Distance charge = meters x per_km / 1000 and time charge = seconds x per_min / 60, each rounded half up to a cent on its own. Subtotal = base + distance + time. The minimum fare applies to that subtotal only; the booking fee is added after the minimum. Return the distance charge, time charge and fare.

Why this case matters

Ride-hailing prices are computed per trip at scale; ordering, unit and boundary slips become systematic over- or under-charging.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: distance cent rounding{"distance": 312, "fare": 675, "time": 18}{"distance": 313, "fare": 675, "time": 18}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 ↗