{
  "id": "tool-reference-v1",
  "version": "1.0.0",
  "published": "2026-11-12",
  "scope": "Fixed synthetic, nonexhaustive examples for the shipped measurement, pricing and final-total allocation tools. Machine field names and explanations are English; numeric input/output decimals use ASCII strings and generic units. No live prices, tax or currency inference, private inputs, personalized advice, external certification or ranking claim.",
  "review": {
    "method": "Independent model analysis and exact rational arithmetic; helper conformance tested separately.",
    "external": "not-verified",
    "nativeLanguage": "not-verified"
  },
  "format": {
    "machineLanguage": "en",
    "inputLocale": "en",
    "decimalStrings": "Inputs use ASCII base-10 decimal strings without grouping or exponents. Output decimal quantities are canonical exact real-unit strings: no redundant trailing fractional zeros, plus sign or negative zero. They are not JSON Number values.",
    "rational": {
      "shape": {
        "numerator": "integer string",
        "denominator": "positive integer string"
      },
      "canonical": "Reduced to greatest-common-divisor 1, with positive denominator; zero is 0/1. Rationals must not be converted through binary floating point for equality or boundary decisions."
    },
    "units": "Measurement signed/absolute and pricing profit use real generic units. Measurement relative is dimensionless; measurement percent and pricing margin/markup are percentage-valued numbers, so 20/1 means 20%, not a dimensionless ratio of 20.",
    "undefined": "null denotes an undefined zero-denominator ratio. It is not zero, Infinity, NaN, an error status or a missing observation.",
    "allocationUnits": "totalUnits, allocatedUnits, eachUnits and subtotalUnits are exact integer strings in the selected 10^-places accounting unit. Within case expectations, only places and bounded people/group counts are JSON integers.",
    "display": {
      "locale": "en",
      "meaning": "Optional text is a rounded display, separate from exact expectations. An approximate flag is true when that displayed number differs from the exact value.",
      "rounding": "Nearest, halfway away from zero; trailing fractional zeros removed. Relative display uses at most 6 decimals; percentage-valued display uses at most 4. percentNumber excludes the percent sign; pricing markup text includes it."
    },
    "errors": "Invalid fixed inputs return status:error plus the first failing field in tool validation order. This pack does not cover empty or every lexical-invalid input."
  },
  "tools": {
    "measurement": {
      "routeTemplate": "/{locale}/tools/#measurement-check",
      "limits": {
        "referenceMeasuredAbsMax": "1000000000",
        "toleranceMin": "0",
        "toleranceMax": "100",
        "originalFractionDigitsMax": 6,
        "inputLengthMax": 64
      },
      "contract": "Signed error = measured-reference; absolute error = abs(signed). Relative error = absolute/abs(reference), percent error = relative*100. Bounds are reference +/- abs(reference)*tolerance/100 and are inclusive, decided exactly before display rounding. A zero reference leaves both ratios null and its band at [0,0]."
    },
    "pricing": {
      "routeTemplate": "/{locale}/blog/margin-vs-markup/#pricing-workbench",
      "limits": {
        "costPriceMin": "0",
        "costPriceMax": "1000000000",
        "originalFractionDigitsMax": 6,
        "inputLengthMax": 64
      },
      "contract": "Profit = price-cost; margin = profit/price*100; markup = profit/cost*100. Negative profit is valid; zero denominators produce null ratios; negative cost/price inputs are rejected."
    },
    "allocation": {
      "routeTemplate": "/{locale}/tools/tip/#bill-allocation",
      "limits": {
        "totalMin": "0",
        "totalMax": "1000000000",
        "originalFractionDigitsMax": 6,
        "inputLengthMax": 64,
        "places": [
          0,
          2,
          3
        ],
        "peopleMin": 1,
        "peopleMax": 1000
      },
      "contract": "The total must be exactly expressible in the selected accounting unit; extra trailing zeros are accepted within the six-original-fractional-digit limit, other excess digits are rejected. People must be whole, including decimal spellings such as 3.0. Shares differ by at most one selected minor unit; extra units go to the first people in an agreed order. Extra group first when present; base group retained including zero shares. No currency conversion, cash-denomination rounding or payment processing."
    }
  },
  "cases": [
    {
      "id": "M1",
      "tool": "measurement",
      "inputs": {
        "reference": "100",
        "measured": "102",
        "tolerance": "2"
      },
      "expected": {
        "status": "valid",
        "signed": "2",
        "absolute": "2",
        "relative": {
          "numerator": "1",
          "denominator": "50"
        },
        "percent": {
          "numerator": "2",
          "denominator": "1"
        },
        "lower": {
          "numerator": "98",
          "denominator": "1"
        },
        "upper": {
          "numerator": "102",
          "denominator": "1"
        },
        "within": true
      },
      "formula": "102 - 100 = 2; abs(2) / abs(100) = 1/50; 100 * (1/50) = 2; bounds = [98, 102]; 102 is included.",
      "limitation": "Tolerance is a symmetric inclusive mathematical band, not measurement uncertainty or certification."
    },
    {
      "id": "M2",
      "tool": "measurement",
      "inputs": {
        "reference": "0",
        "measured": "1",
        "tolerance": "5"
      },
      "expected": {
        "status": "valid",
        "signed": "1",
        "absolute": "1",
        "relative": null,
        "percent": null,
        "lower": {
          "numerator": "0",
          "denominator": "1"
        },
        "upper": {
          "numerator": "0",
          "denominator": "1"
        },
        "within": false
      },
      "formula": "1 - 0 = 1; abs(0) * 5 / 100 = 0; bounds = [0, 0]; relative and percent error are undefined.",
      "limitation": "A zero reference has no finite relative or percent error; a nonzero measured value is outside its zero-width band."
    },
    {
      "id": "M3",
      "tool": "measurement",
      "inputs": {
        "reference": "0",
        "measured": "0",
        "tolerance": "0"
      },
      "expected": {
        "status": "valid",
        "signed": "0",
        "absolute": "0",
        "relative": null,
        "percent": null,
        "lower": {
          "numerator": "0",
          "denominator": "1"
        },
        "upper": {
          "numerator": "0",
          "denominator": "1"
        },
        "within": true
      },
      "formula": "0 - 0 = 0; bounds = [0, 0]; 0 is included, but division by the zero reference remains undefined.",
      "limitation": "Passing the absolute band test does not make a zero-denominator relative or percent error defined."
    },
    {
      "id": "M4",
      "tool": "measurement",
      "inputs": {
        "reference": "-100",
        "measured": "-98",
        "tolerance": "2"
      },
      "expected": {
        "status": "valid",
        "signed": "2",
        "absolute": "2",
        "relative": {
          "numerator": "1",
          "denominator": "50"
        },
        "percent": {
          "numerator": "2",
          "denominator": "1"
        },
        "lower": {
          "numerator": "-102",
          "denominator": "1"
        },
        "upper": {
          "numerator": "-98",
          "denominator": "1"
        },
        "within": true
      },
      "formula": "-98 - (-100) = 2; abs(2) / abs(-100) = 1/50; bounds = [-102, -98]; -98 is included.",
      "limitation": "Relative error uses the absolute reference magnitude; its sign must not reverse the tolerance interval."
    },
    {
      "id": "M5",
      "tool": "measurement",
      "inputs": {
        "reference": "100",
        "measured": "101.000001",
        "tolerance": "1"
      },
      "expected": {
        "status": "valid",
        "signed": "1.000001",
        "absolute": "1.000001",
        "relative": {
          "numerator": "1000001",
          "denominator": "100000000"
        },
        "percent": {
          "numerator": "1000001",
          "denominator": "1000000"
        },
        "lower": {
          "numerator": "99",
          "denominator": "1"
        },
        "upper": {
          "numerator": "101",
          "denominator": "1"
        },
        "within": false,
        "display": {
          "relative": {
            "text": "0.01",
            "approximate": true
          },
          "percentNumber": {
            "text": "1",
            "approximate": true
          }
        }
      },
      "formula": "101.000001 - 100 = 1.000001; relative = 1000001/100000000; percent = 1000001/1000000; 101.000001 > 101.",
      "limitation": "The relative display rounds to 0.01 and percent number to 1; exact arithmetic still places the value outside the band."
    },
    {
      "id": "M6",
      "tool": "measurement",
      "inputs": {
        "reference": "0.000001",
        "measured": "0.000002",
        "tolerance": "100"
      },
      "expected": {
        "status": "valid",
        "signed": "0.000001",
        "absolute": "0.000001",
        "relative": {
          "numerator": "1",
          "denominator": "1"
        },
        "percent": {
          "numerator": "100",
          "denominator": "1"
        },
        "lower": {
          "numerator": "0",
          "denominator": "1"
        },
        "upper": {
          "numerator": "1",
          "denominator": "500000"
        },
        "within": true
      },
      "formula": "0.000002 - 0.000001 = 0.000001; relative = 1; percent = 100; bounds = [0, 0.000002]; upper bound included.",
      "limitation": "This is the smallest accepted positive six-decimal reference, not a proof of floating-point or physical-measurement precision."
    },
    {
      "id": "M7",
      "tool": "measurement",
      "inputs": {
        "reference": "100",
        "measured": "102",
        "tolerance": "-1"
      },
      "expected": {
        "status": "error",
        "field": "tolerance"
      },
      "formula": "-1 < 0, so the tolerance input is rejected before any band or ratio is returned.",
      "limitation": "Tolerance must lie between 0 and 100 inclusive; invalid input is not a numerical result."
    },
    {
      "id": "P1",
      "tool": "pricing",
      "inputs": {
        "cost": "80",
        "price": "100"
      },
      "expected": {
        "status": "valid",
        "profit": "20",
        "margin": {
          "numerator": "20",
          "denominator": "1"
        },
        "markup": {
          "numerator": "25",
          "denominator": "1"
        }
      },
      "formula": "profit = 100 - 80 = 20; margin = 20/100 * 100 = 20%; markup = 20/80 * 100 = 25%.",
      "limitation": "Margin divides by selling price; markup divides by cost. The two percentages are not interchangeable."
    },
    {
      "id": "P2",
      "tool": "pricing",
      "inputs": {
        "cost": "0",
        "price": "100"
      },
      "expected": {
        "status": "valid",
        "profit": "100",
        "margin": {
          "numerator": "100",
          "denominator": "1"
        },
        "markup": null
      },
      "formula": "profit = 100 - 0 = 100; margin = 100/100 * 100 = 100%; markup divides by zero and is undefined.",
      "limitation": "Zero cost does not justify manufacturing a finite or infinite markup percentage."
    },
    {
      "id": "P3",
      "tool": "pricing",
      "inputs": {
        "cost": "100",
        "price": "0"
      },
      "expected": {
        "status": "valid",
        "profit": "-100",
        "margin": null,
        "markup": {
          "numerator": "-100",
          "denominator": "1"
        }
      },
      "formula": "profit = 0 - 100 = -100; margin divides by zero and is undefined; markup = -100/100 * 100 = -100%.",
      "limitation": "Zero selling price leaves margin undefined even though loss and markup remain defined."
    },
    {
      "id": "P4",
      "tool": "pricing",
      "inputs": {
        "cost": "3",
        "price": "4"
      },
      "expected": {
        "status": "valid",
        "profit": "1",
        "margin": {
          "numerator": "25",
          "denominator": "1"
        },
        "markup": {
          "numerator": "100",
          "denominator": "3"
        },
        "display": {
          "markup": {
            "text": "33.3333%",
            "approximate": true
          }
        }
      },
      "formula": "profit = 4 - 3 = 1; margin = 1/4 * 100 = 25%; markup = 1/3 * 100 = (100/3)%.",
      "limitation": "The exact repeating markup is 100/3 percent; 33.3333% is a rounded display, not an exact equivalence."
    },
    {
      "id": "P5",
      "tool": "pricing",
      "inputs": {
        "cost": "0.000001",
        "price": "0.000002"
      },
      "expected": {
        "status": "valid",
        "profit": "0.000001",
        "margin": {
          "numerator": "50",
          "denominator": "1"
        },
        "markup": {
          "numerator": "100",
          "denominator": "1"
        }
      },
      "formula": "profit = 0.000001; margin = 0.000001/0.000002 * 100 = 50%; markup = 0.000001/0.000001 * 100 = 100%.",
      "limitation": "Exact decimal inputs are bounded to six original fractional digits; no currency or transaction precision is inferred."
    },
    {
      "id": "P6",
      "tool": "pricing",
      "inputs": {
        "cost": "100",
        "price": "80"
      },
      "expected": {
        "status": "valid",
        "profit": "-20",
        "margin": {
          "numerator": "-25",
          "denominator": "1"
        },
        "markup": {
          "numerator": "-20",
          "denominator": "1"
        }
      },
      "formula": "profit = 80 - 100 = -20; margin = -20/80 * 100 = -25%; markup = -20/100 * 100 = -20%.",
      "limitation": "Negative profit is a valid mathematical loss; inputs themselves must remain nonnegative."
    },
    {
      "id": "P7",
      "tool": "pricing",
      "inputs": {
        "cost": "-1",
        "price": "10"
      },
      "expected": {
        "status": "error",
        "field": "cost"
      },
      "formula": "-1 < 0, so the cost input is rejected before profit, margin or markup is returned.",
      "limitation": "A negative cost is outside this tool contract; it is not silently reinterpreted as income or a credit."
    },
    {
      "id": "A1",
      "tool": "allocation",
      "inputs": {
        "total": "10.00",
        "people": "3",
        "places": 2
      },
      "expected": {
        "status": "valid",
        "places": 2,
        "people": 3,
        "totalUnits": "1000",
        "allocatedUnits": "1000",
        "extraPeople": 1,
        "groups": [
          {
            "kind": "extra",
            "count": 1,
            "eachUnits": "334",
            "subtotalUnits": "334"
          },
          {
            "kind": "base",
            "count": 2,
            "eachUnits": "333",
            "subtotalUnits": "666"
          }
        ]
      },
      "formula": "1000 selected minor units = 1 * 334 + 2 * 333; the first person receives one extra unit.",
      "limitation": "Selected two-decimal accounting units are generic. Shares are not a payment instruction or a cash-denomination rule."
    },
    {
      "id": "A2",
      "tool": "allocation",
      "inputs": {
        "total": "10",
        "people": "3",
        "places": 0
      },
      "expected": {
        "status": "valid",
        "places": 0,
        "people": 3,
        "totalUnits": "10",
        "allocatedUnits": "10",
        "extraPeople": 1,
        "groups": [
          {
            "kind": "extra",
            "count": 1,
            "eachUnits": "4",
            "subtotalUnits": "4"
          },
          {
            "kind": "base",
            "count": 2,
            "eachUnits": "3",
            "subtotalUnits": "6"
          }
        ]
      },
      "formula": "10 selected whole units = 1 * 4 + 2 * 3; the first person receives the remaining whole unit.",
      "limitation": "Choosing zero decimal places changes the accounting unit; the tool does not infer a currency."
    },
    {
      "id": "A3",
      "tool": "allocation",
      "inputs": {
        "total": "1.000",
        "people": "3",
        "places": 3
      },
      "expected": {
        "status": "valid",
        "places": 3,
        "people": 3,
        "totalUnits": "1000",
        "allocatedUnits": "1000",
        "extraPeople": 1,
        "groups": [
          {
            "kind": "extra",
            "count": 1,
            "eachUnits": "334",
            "subtotalUnits": "334"
          },
          {
            "kind": "base",
            "count": 2,
            "eachUnits": "333",
            "subtotalUnits": "666"
          }
        ]
      },
      "formula": "1000 selected thousandth-units = 1 * 334 + 2 * 333, equivalent to 0.334 + 0.333 + 0.333 = 1.000.",
      "limitation": "The same integer-unit pattern as A1 has a different real-unit scale because places is 3 rather than 2."
    },
    {
      "id": "A4",
      "tool": "allocation",
      "inputs": {
        "total": "0.00",
        "people": "3",
        "places": 2
      },
      "expected": {
        "status": "valid",
        "places": 2,
        "people": 3,
        "totalUnits": "0",
        "allocatedUnits": "0",
        "extraPeople": 0,
        "groups": [
          {
            "kind": "base",
            "count": 3,
            "eachUnits": "0",
            "subtotalUnits": "0"
          }
        ]
      },
      "formula": "0 selected minor units = 3 * 0; no extra group is needed.",
      "limitation": "Zero shares remain explicit; an omitted extra group is not an omitted person or an undefined result."
    },
    {
      "id": "A5",
      "tool": "allocation",
      "inputs": {
        "total": "1.001",
        "people": "3",
        "places": 2
      },
      "expected": {
        "status": "error",
        "field": "total"
      },
      "formula": "1.001 * 100 = 100.1, which is not an integer number of the selected two-decimal units.",
      "limitation": "Nonzero excess precision is rejected rather than rounding the final total to fit the selected unit."
    },
    {
      "id": "A6",
      "tool": "allocation",
      "inputs": {
        "total": "10.00",
        "people": "0",
        "places": 2
      },
      "expected": {
        "status": "error",
        "field": "people"
      },
      "formula": "0 < 1, so the people input is rejected before allocation.",
      "limitation": "People must be a whole count from 1 to 1000 inclusive; division among zero people is not defined."
    },
    {
      "id": "A7",
      "tool": "allocation",
      "inputs": {
        "total": "10.00",
        "people": "1000",
        "places": 2
      },
      "expected": {
        "status": "valid",
        "places": 2,
        "people": 1000,
        "totalUnits": "1000",
        "allocatedUnits": "1000",
        "extraPeople": 0,
        "groups": [
          {
            "kind": "base",
            "count": 1000,
            "eachUnits": "1",
            "subtotalUnits": "1000"
          }
        ]
      },
      "formula": "1000 selected minor units / 1000 people = 1 unit each; 1000 * 1 = 1000.",
      "limitation": "This exercises the maximum people count, not the maximum permitted total; cash rounding and payment processing are excluded."
    }
  ]
}
