{
  "schemaVersion": 1,
  "slug": "glove-size-calculator",
  "category": "fashion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "3d7d725217539b739b1a58e41edc21c5938dfb76c4d545dc20eb1befab884d4f",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/glove-size-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "US = round(2c)/2; UK = round(2(US−0.5))/2; EU = round(2×2.54×US)/2",
    "vars": [
      [
        "c",
        "Hand circumference in inches"
      ],
      [
        "US",
        "US glove size"
      ],
      [
        "UK",
        "UK glove size"
      ],
      [
        "EU",
        "EU glove size"
      ]
    ],
    "note": "US reference = hand circumference in inches rounded to the nearest 0.5; UK reference = US − 0.5; EU reference = US × 2.54 cm. This is a simplified crosswalk, not a fit guarantee."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const c=unit==='cm'?circumference/2.54:circumference; if(!Number.isFinite(c)||c<4||c>16)return {usSize:null,ukSize:null,euSize:null,__error:'inputError'}; const us=Math.round(c*2)/2; return {usSize:us,ukSize:Math.round((us-0.5)*2)/2,euSize:Math.round(us*2.54*2)/2};",
    "inputs": [
      {
        "name": "circumference",
        "type": "number",
        "default": 8,
        "min": 4,
        "max": 16,
        "step": 0.1,
        "unitField": "unit",
        "minByUnit": {
          "in": 4,
          "cm": 10.16
        },
        "maxByUnit": {
          "in": 16,
          "cm": 40.64
        },
        "unitScales": {
          "in": 1,
          "cm": 0.39370078740157477
        }
      },
      {
        "name": "unit",
        "type": "select",
        "default": "in",
        "options": [
          {
            "value": "in"
          },
          {
            "value": "cm"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "usSize",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "ukSize",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "euSize",
        "precision": 0,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
