{"abstract":"1000 US cents convert to 151370 yen instead of 1514 yen.","category":"Currency rounding and FX conversion","checks":6,"contract":"solve(amount_minor, from_exp, to_exp, rate): amount_minor is an integer count of source minor units, rate a decimal string giving target major units per source major unit. The target minor amount is amount_minor * rate * 10**(to_exp - from_exp), computed exactly and rounded half-even to an integer.","evaluation_group":"w2-currency_rounding_and_fx_conversion-minor-unit-integer-conversion","failed_approach":"Rescaling by 10**(from_exp - to_exp) inverts the adjustment.","family":"w2-currency_rounding_and_fx_conversion-minor-unit-integer-conversion-exponent-rescale","id":"FA-61986","implementations":{"attempt":{"sha256":"2c80f6e91d653b2e7c2c775d7b5aeba8d76a4096d720bec22aa6ca7f55a6f71d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(amount_minor, from_exp, to_exp, rate):\n    scale = Decimal(10) ** (from_exp - to_exp)\n    v = Decimal(amount_minor) * Decimal(rate) * scale\n    return int(v.quantize(Decimal(1), rounding=ROUND_HALF_EVEN))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression exponent-rescale 1', (1000, 2, 0, '151.37'), 1514),\n  ('regression exponent-rescale 2', (1, 0, 3, '0.3071'), 307), ('control: float trap tie', (115, 2, 2, '1.1'), 126),\n  ('control: negative exact', (-250, 2, 2, '0.5'), -125), ('control: negative tie', (-3, 2, 2, '0.5'), -2),\n  ('control: zero', (0, 2, 0, '151.37'), 0)],\n [('regression exponent-rescale 1', (987654321, 2, 3, '0.30712'), 3033283951),\n  ('regression exponent-rescale 2', (64824, 0, 2, '51.9345'), 336660203),\n  ('control: yen to dinar', (1, 0, 3, '0.3071'), 307), ('control: negative tie', (-3, 2, 2, '0.5'), -2),\n  ('control: zero', (0, 2, 0, '151.37'), 0), ('control: precise rate', (123456, 2, 2, '1.08347'), 133761)],\n [('regression exponent-rescale 1', (806786, 2, 3, '113828.2'), 918349981652),\n  ('regression exponent-rescale 2', (755323, 2, 4, '7.24667'), 547357652),\n  ('control: precise rate', (123456, 2, 2, '1.08347'), 133761),\n  ('control: large', (987654321, 2, 3, '0.30712'), 3033283951), ('control: cents to yen', (1000, 2, 0, '151.37'), 1514),\n  ('control: float trap tie', (115, 2, 2, '1.1'), 126)],\n [('regression exponent-rescale 1', (943097, 3, 2, '109.9318'), 10367635),\n  ('regression exponent-rescale 2', (286850, 2, 3, '1.495849'), 4290843),\n  ('control: float trap tie', (115, 2, 2, '1.1'), 126), ('control: negative exact', (-250, 2, 2, '0.5'), -125),\n  ('control: yen to dinar', (1, 0, 3, '0.3071'), 307), ('control: negative tie', (-3, 2, 2, '0.5'), -2)],\n [('regression exponent-rescale 1', (253357, 0, 4, '18.88901'), 47856629066),\n  ('regression exponent-rescale 2', (190708, 0, 4, '188.1068'), 358734716144),\n  ('control: negative tie', (-3, 2, 2, '0.5'), -2), ('control: zero', (0, 2, 0, '151.37'), 0),\n  ('control: precise rate', (123456, 2, 2, '1.08347'), 133761),\n  ('control: large', (987654321, 2, 3, '0.30712'), 3033283951)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"bbef126e8627570f69d8579e34945361a4e595704ba3fc2f5e8dece8d41f8c04","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(amount_minor, from_exp, to_exp, rate):\n    scale = Decimal(1)\n    v = Decimal(amount_minor) * Decimal(rate) * scale\n    return int(v.quantize(Decimal(1), rounding=ROUND_HALF_EVEN))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression exponent-rescale 1', (1000, 2, 0, '151.37'), 1514),\n  ('regression exponent-rescale 2', (1, 0, 3, '0.3071'), 307), ('control: float trap tie', (115, 2, 2, '1.1'), 126),\n  ('control: negative exact', (-250, 2, 2, '0.5'), -125), ('control: negative tie', (-3, 2, 2, '0.5'), -2),\n  ('control: zero', (0, 2, 0, '151.37'), 0)],\n [('regression exponent-rescale 1', (987654321, 2, 3, '0.30712'), 3033283951),\n  ('regression exponent-rescale 2', (64824, 0, 2, '51.9345'), 336660203),\n  ('control: yen to dinar', (1, 0, 3, '0.3071'), 307), ('control: negative tie', (-3, 2, 2, '0.5'), -2),\n  ('control: zero', (0, 2, 0, '151.37'), 0), ('control: precise rate', (123456, 2, 2, '1.08347'), 133761)],\n [('regression exponent-rescale 1', (806786, 2, 3, '113828.2'), 918349981652),\n  ('regression exponent-rescale 2', (755323, 2, 4, '7.24667'), 547357652),\n  ('control: precise rate', (123456, 2, 2, '1.08347'), 133761),\n  ('control: large', (987654321, 2, 3, '0.30712'), 3033283951), ('control: cents to yen', (1000, 2, 0, '151.37'), 1514),\n  ('control: float trap tie', (115, 2, 2, '1.1'), 126)],\n [('regression exponent-rescale 1', (943097, 3, 2, '109.9318'), 10367635),\n  ('regression exponent-rescale 2', (286850, 2, 3, '1.495849'), 4290843),\n  ('control: float trap tie', (115, 2, 2, '1.1'), 126), ('control: negative exact', (-250, 2, 2, '0.5'), -125),\n  ('control: yen to dinar', (1, 0, 3, '0.3071'), 307), ('control: negative tie', (-3, 2, 2, '0.5'), -2)],\n [('regression exponent-rescale 1', (253357, 0, 4, '18.88901'), 47856629066),\n  ('regression exponent-rescale 2', (190708, 0, 4, '188.1068'), 358734716144),\n  ('control: negative tie', (-3, 2, 2, '0.5'), -2), ('control: zero', (0, 2, 0, '151.37'), 0),\n  ('control: precise rate', (123456, 2, 2, '1.08347'), 133761),\n  ('control: large', (987654321, 2, 3, '0.30712'), 3033283951)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"b51562ec2ea32dcb39966a1d4f7ff61a99d7bd255083c16a187f7486917f2dcf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(amount_minor, from_exp, to_exp, rate):\n    scale = Decimal(10) ** (to_exp - from_exp)\n    v = Decimal(amount_minor) * Decimal(rate) * scale\n    return int(v.quantize(Decimal(1), rounding=ROUND_HALF_EVEN))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression exponent-rescale 1', (1000, 2, 0, '151.37'), 1514),\n  ('regression exponent-rescale 2', (1, 0, 3, '0.3071'), 307), ('control: float trap tie', (115, 2, 2, '1.1'), 126),\n  ('control: negative exact', (-250, 2, 2, '0.5'), -125), ('control: negative tie', (-3, 2, 2, '0.5'), -2),\n  ('control: zero', (0, 2, 0, '151.37'), 0)],\n [('regression exponent-rescale 1', (987654321, 2, 3, '0.30712'), 3033283951),\n  ('regression exponent-rescale 2', (64824, 0, 2, '51.9345'), 336660203),\n  ('control: yen to dinar', (1, 0, 3, '0.3071'), 307), ('control: negative tie', (-3, 2, 2, '0.5'), -2),\n  ('control: zero', (0, 2, 0, '151.37'), 0), ('control: precise rate', (123456, 2, 2, '1.08347'), 133761)],\n [('regression exponent-rescale 1', (806786, 2, 3, '113828.2'), 918349981652),\n  ('regression exponent-rescale 2', (755323, 2, 4, '7.24667'), 547357652),\n  ('control: precise rate', (123456, 2, 2, '1.08347'), 133761),\n  ('control: large', (987654321, 2, 3, '0.30712'), 3033283951), ('control: cents to yen', (1000, 2, 0, '151.37'), 1514),\n  ('control: float trap tie', (115, 2, 2, '1.1'), 126)],\n [('regression exponent-rescale 1', (943097, 3, 2, '109.9318'), 10367635),\n  ('regression exponent-rescale 2', (286850, 2, 3, '1.495849'), 4290843),\n  ('control: float trap tie', (115, 2, 2, '1.1'), 126), ('control: negative exact', (-250, 2, 2, '0.5'), -125),\n  ('control: yen to dinar', (1, 0, 3, '0.3071'), 307), ('control: negative tie', (-3, 2, 2, '0.5'), -2)],\n [('regression exponent-rescale 1', (253357, 0, 4, '18.88901'), 47856629066),\n  ('regression exponent-rescale 2', (190708, 0, 4, '188.1068'), 358734716144),\n  ('control: negative tie', (-3, 2, 2, '0.5'), -2), ('control: zero', (0, 2, 0, '151.37'), 0),\n  ('control: precise rate', (123456, 2, 2, '1.08347'), 133761),\n  ('control: large', (987654321, 2, 3, '0.30712'), 3033283951)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-currency_rounding_and_fx_conversion-minor-unit-integer-conversion-exponent-rescale","generated_at":"2026-09-29T14:47:00.362086+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.","repair":"Multiply by 10**(to_exp - from_exp) to move between minor-unit scales.","root_cause":"The factor 10**(to_exp - from_exp) is omitted when converting minor units.","sha256":"4f9d56da93264edda97bf58fd0ed843c665abe3872c86339561b7ecd5749a98f","title":"Minor units are converted without rescaling between currency exponents · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.394,"exit_code":1,"observations":[{"actual":15137000,"check":"regression exponent-rescale 1","expected":1514,"passed":false},{"actual":0,"check":"regression exponent-rescale 2","expected":307,"passed":false},{"actual":126,"check":"control: float trap tie","expected":126,"passed":true},{"actual":-125,"check":"control: negative exact","expected":-125,"passed":true},{"actual":-2,"check":"control: negative tie","expected":-2,"passed":true},{"actual":0,"check":"control: zero","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression exponent-rescale 1\", \"actual\": 15137000, \"expected\": 1514, \"passed\": false}, {\"check\": \"regression exponent-rescale 2\", \"actual\": 0, \"expected\": 307, \"passed\": false}, {\"check\": \"control: float trap tie\", \"actual\": 126, \"expected\": 126, \"passed\": true}, {\"check\": \"control: negative exact\", \"actual\": -125, \"expected\": -125, \"passed\": true}, {\"check\": \"control: negative tie\", \"actual\": -2, \"expected\": -2, \"passed\": true}, {\"check\": \"control: zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.641,"exit_code":1,"observations":[{"actual":151370,"check":"regression exponent-rescale 1","expected":1514,"passed":false},{"actual":0,"check":"regression exponent-rescale 2","expected":307,"passed":false},{"actual":126,"check":"control: float trap tie","expected":126,"passed":true},{"actual":-125,"check":"control: negative exact","expected":-125,"passed":true},{"actual":-2,"check":"control: negative tie","expected":-2,"passed":true},{"actual":0,"check":"control: zero","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression exponent-rescale 1\", \"actual\": 151370, \"expected\": 1514, \"passed\": false}, {\"check\": \"regression exponent-rescale 2\", \"actual\": 0, \"expected\": 307, \"passed\": false}, {\"check\": \"control: float trap tie\", \"actual\": 126, \"expected\": 126, \"passed\": true}, {\"check\": \"control: negative exact\", \"actual\": -125, \"expected\": -125, \"passed\": true}, {\"check\": \"control: negative tie\", \"actual\": -2, \"expected\": -2, \"passed\": true}, {\"check\": \"control: zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.851,"exit_code":0,"observations":[{"actual":1514,"check":"regression exponent-rescale 1","expected":1514,"passed":true},{"actual":307,"check":"regression exponent-rescale 2","expected":307,"passed":true},{"actual":126,"check":"control: float trap tie","expected":126,"passed":true},{"actual":-125,"check":"control: negative exact","expected":-125,"passed":true},{"actual":-2,"check":"control: negative tie","expected":-2,"passed":true},{"actual":0,"check":"control: zero","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression exponent-rescale 1\", \"actual\": 1514, \"expected\": 1514, \"passed\": true}, {\"check\": \"regression exponent-rescale 2\", \"actual\": 307, \"expected\": 307, \"passed\": true}, {\"check\": \"control: float trap tie\", \"actual\": 126, \"expected\": 126, \"passed\": true}, {\"check\": \"control: negative exact\", \"actual\": -125, \"expected\": -125, \"passed\": true}, {\"check\": \"control: negative tie\", \"actual\": -2, \"expected\": -2, \"passed\": true}, {\"check\": \"control: zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}