FAILURE MAP
← Case archive

FA-84676 / Betting odds conversion / Open access

Unsigned 100 read as a decimal price · case 01

Typing "100" produces a 100.00 decimal price instead of even money.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The unsigned-American test requires the integer to exceed 100.

VERIFIED REPAIR

Treat unsigned integers of 100 or more as American lines.

Unsuccessful approach: Lowering the threshold to 10 turns small decimal prices like "50" into American lines.

Case contract

Normalise user-typed odds to a decimal price string with two decimals (half up). Detection order: text containing "/" is fractional a/b; text starting with "+" or "-" is American (magnitude >= 100); an unsigned integer >= 100 is a positive American line; anything else is a decimal price, where a comma is the decimal separator ("2,50"). Unparseable input, zero denominators, magnitudes below 100 and results not above 1 return "invalid".

Why this case matters

Bet-slip inputs accept several odds formats and must not misclassify ambiguous text.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(text):
    t = text.strip()
    try:
        if '/' in t:
            a, b = t.split('/')
            dec = 1 + Fraction(int(a), int(b))
        elif t[:1] in ('+', '-'):
            n = int(t[1:])
            if n < 100:
                return 'invalid'
            dec = 1 + (Fraction(n, 100) if t[0] == '+' else Fraction(100, n))
        elif t.isdigit() and int(t) > 100:
            dec = 1 + Fraction(int(t), 100)
        else:
            dec = Fraction(t.replace(',', '.'))
    except (ValueError, ZeroDivisionError):
        return 'invalid'
    if dec <= 1:
        return 'invalid'
    c = math.floor(dec * 100 + Fraction(1, 2))
    return '%d.%02d' % (c // 100, c % 100)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('5.92',), '5.92'),
  ('variant scenario 2', ('7.95',), '7.95')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('1/5',), '1.20'),
  ('variant scenario 2', ('-421',), '1.24')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('3.75',), '3.75'),
  ('variant scenario 2', ('4.75',), '4.75')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('variant scenario 1', ('469',), '5.69'),
  ('variant scenario 2', ('+481',), '5.81')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('variant scenario 1', ('20/4',), '6.00'),
  ('variant scenario 2', ('5/0',), 'invalid')]]
for label, args, expected in cases[N - 1]:
    check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control fractional3.503.50Passed
control negative american1.911.91Passed
boundary unsigned hundred100.002.00Failed
boundary small integer is decimal3.003.00Passed
boundary decimal comma2.502.50Passed
control empty inputinvalidinvalidPassed
regression: unsigned american threshold100.002.00Failed
regression: unsigned american threshold50.0050.00Passed
variant scenario 15.925.92Passed
variant scenario 27.957.95Passed

SHA-256 / b3728437b3f76c5996e6a3b785ff861b0d88ad7cb708d9d7601ab2a9979e26b8

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(text):
    t = text.strip()
    try:
        if '/' in t:
            a, b = t.split('/')
            dec = 1 + Fraction(int(a), int(b))
        elif t[:1] in ('+', '-'):
            n = int(t[1:])
            if n < 100:
                return 'invalid'
            dec = 1 + (Fraction(n, 100) if t[0] == '+' else Fraction(100, n))
        elif t.isdigit() and int(t) >= 10:
            dec = 1 + Fraction(int(t), 100)
        else:
            dec = Fraction(t.replace(',', '.'))
    except (ValueError, ZeroDivisionError):
        return 'invalid'
    if dec <= 1:
        return 'invalid'
    c = math.floor(dec * 100 + Fraction(1, 2))
    return '%d.%02d' % (c // 100, c % 100)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('5.92',), '5.92'),
  ('variant scenario 2', ('7.95',), '7.95')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('1/5',), '1.20'),
  ('variant scenario 2', ('-421',), '1.24')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('3.75',), '3.75'),
  ('variant scenario 2', ('4.75',), '4.75')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('variant scenario 1', ('469',), '5.69'),
  ('variant scenario 2', ('+481',), '5.81')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('variant scenario 1', ('20/4',), '6.00'),
  ('variant scenario 2', ('5/0',), 'invalid')]]
for label, args, expected in cases[N - 1]:
    check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control fractional3.503.50Passed
control negative american1.911.91Passed
boundary unsigned hundred2.002.00Passed
boundary small integer is decimal3.003.00Passed
boundary decimal comma2.502.50Passed
control empty inputinvalidinvalidPassed
regression: unsigned american threshold2.002.00Passed
regression: unsigned american threshold1.5050.00Failed
variant scenario 15.925.92Passed
variant scenario 27.957.95Passed

SHA-256 / 2b12e9ccf4e2c740ef3a662939daa34661c5a4a6b4cf7f4c6aac9429444b4143

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(text):
    t = text.strip()
    try:
        if '/' in t:
            a, b = t.split('/')
            dec = 1 + Fraction(int(a), int(b))
        elif t[:1] in ('+', '-'):
            n = int(t[1:])
            if n < 100:
                return 'invalid'
            dec = 1 + (Fraction(n, 100) if t[0] == '+' else Fraction(100, n))
        elif t.isdigit() and int(t) >= 100:
            dec = 1 + Fraction(int(t), 100)
        else:
            dec = Fraction(t.replace(',', '.'))
    except (ValueError, ZeroDivisionError):
        return 'invalid'
    if dec <= 1:
        return 'invalid'
    c = math.floor(dec * 100 + Fraction(1, 2))
    return '%d.%02d' % (c // 100, c % 100)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('5.92',), '5.92'),
  ('variant scenario 2', ('7.95',), '7.95')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('1/5',), '1.20'),
  ('variant scenario 2', ('-421',), '1.24')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('variant scenario 1', ('3.75',), '3.75'),
  ('variant scenario 2', ('4.75',), '4.75')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('variant scenario 1', ('469',), '5.69'),
  ('variant scenario 2', ('+481',), '5.81')],
 [('control fractional', ('5/2',), '3.50'),
  ('control negative american', ('-110',), '1.91'),
  ('boundary unsigned hundred', ('100',), '2.00'),
  ('boundary small integer is decimal', ('3',), '3.00'),
  ('boundary decimal comma', ('2,50',), '2.50'),
  ('control empty input', ('',), 'invalid'),
  ('regression: unsigned american threshold', ('50',), '50.00'),
  ('regression: unsigned american threshold', ('100',), '2.00'),
  ('variant scenario 1', ('20/4',), '6.00'),
  ('variant scenario 2', ('5/0',), 'invalid')]]
for label, args, expected in cases[N - 1]:
    check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control fractional3.503.50Passed
control negative american1.911.91Passed
boundary unsigned hundred2.002.00Passed
boundary small integer is decimal3.003.00Passed
boundary decimal comma2.502.50Passed
control empty inputinvalidinvalidPassed
regression: unsigned american threshold2.002.00Passed
regression: unsigned american threshold50.0050.00Passed
variant scenario 15.925.92Passed
variant scenario 27.957.95Passed

SHA-256 / 6dcb33d64fe94edd55fea993d23de117cc05a63ba096ca2ddfa7242bd9082d98

Verification & scope

Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any operator, exchange or regulator rule set. 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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:33.257765+00:00.

Case digest / 699e91b4ceae2165ad1a3643001951e50340537afbd0f79bfc11e530f5834daf