{
  "cases": [
    {
      "id": "room-celsius",
      "inputs": {
        "mode": "c-k",
        "value": "25"
      },
      "expected": {
        "binary64_hex": "4072a26666666666"
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "Add the exact offset 273.15 and round once to binary64."
    },
    {
      "id": "kelvin-to-celsius",
      "inputs": {
        "mode": "k-c",
        "value": "298.15"
      },
      "expected": {
        "binary64_hex": "4039000000000000"
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "Subtract the exact offset 273.15."
    },
    {
      "id": "absolute-zero",
      "inputs": {
        "mode": "c-k",
        "value": "-273.15"
      },
      "expected": {
        "binary64_hex": "0000000000000000"
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "Adding the exact offset cancels the input to zero."
    },
    {
      "id": "above-absolute-zero",
      "inputs": {
        "mode": "c-k",
        "value": "-273.1499999999999999999"
      },
      "expected": {
        "binary64_hex": "3bfd83c94fb6d2ac"
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "The exact difference is 10^-19 K before binary64 rounding."
    },
    {
      "id": "below-absolute-zero",
      "inputs": {
        "mode": "c-k",
        "value": "-273.1500000000000000001"
      },
      "expected": {
        "error": {
          "code": "VALUE_OUT_OF_RANGE",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "The exact difference is negative, below the permitted thermodynamic range."
    },
    {
      "id": "negative-kelvin",
      "inputs": {
        "mode": "k-c",
        "value": "-1e-300"
      },
      "expected": {
        "error": {
          "code": "VALUE_OUT_OF_RANGE",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "Negative thermodynamic temperature is outside this conversion contract."
    },
    {
      "id": "nondecimal-value",
      "inputs": {
        "mode": "c-k",
        "value": "abc"
      },
      "expected": {
        "error": {
          "code": "INVALID_NUMBER",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "Decimal transport rejects nonnumeric text."
    },
    {
      "id": "missing-value",
      "inputs": {
        "mode": "k-c",
        "value": ""
      },
      "expected": {
        "error": {
          "code": "MISSING_REQUIRED_INPUT",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-330/sp-330-section-2",
      "derivation": "Empty text cannot supply a temperature point."
    }
  ]
}
