FAILURE MAP
← Case archive

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

Distance charge truncated to the cent · case 02

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

Member previewVariant 2 · 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": 2932, "fare": 3218, "time": 36}{"distance": 2933, "fare": 3219, "time": 36}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 ↗