FAILURE MAP
← Case archive

FA-97000 / Recipe scaling and nutrition / Member archive

Atwater energy calculator: kilojoule rounding stage · case 05

kJ disagrees with the exact energy because it is converted from the rounded kcal.

Member previewVariant 5 · 3 implementations · 8 checks per implementation

Case contract

Gram amounts as strings. Total carbohydrate includes fiber and polyols; available carb = max(0, carb - fiber - polyol). kcal = 4*protein + 9*fat + 4*available + 2*fiber + 7*alcohol + 2.4*polyol. Return [kcal, kJ, fat_energy_pct]: kcal half-up integer of the exact energy, kJ half-up integer of exact kcal * 4.184, fat pct = half-up of 9*fat/exact kcal*100 (0 if energy is 0).

Why this case matters

Recipe energy totals use factor systems where fiber and sugar alcohols are not full carbohydrate.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
regression: kilojoule rounding stage[450, 1883, 18][450, 1881, 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 ↗