{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.subtraction.agent.input.json",
  "title": "Subtraction — agent input",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "const": "difference"
        },
        "minuend": {
          "anyOf": [
            {
              "type": "number",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
            }
          ]
        },
        "subtrahend": {
          "anyOf": [
            {
              "type": "number",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
            }
          ]
        },
        "difference": {
          "anyOf": [
            {
              "type": "number",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
            }
          ]
        }
      },
      "anyOf": [
        {
          "required": [
            "minuend",
            "subtrahend"
          ]
        },
        {
          "required": [
            "minuend",
            "difference"
          ]
        },
        {
          "required": [
            "subtrahend",
            "difference"
          ]
        }
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "minuend",
        "subtrahend"
      ],
      "properties": {
        "mode": {
          "const": "long"
        },
        "minuend": {
          "anyOf": [
            {
              "type": "number",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
            }
          ]
        },
        "subtrahend": {
          "anyOf": [
            {
              "type": "number",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
            }
          ]
        }
      }
    }
  ],
  "description": "Solve any missing subtraction term with binary64, or exact non-negative decimal Long subtraction with borrowing up to48 aligned columns.. Mode-discriminated agent contract. Named fields are canonical; a/b are legacy share-URL aliases. (calculation_version 1.0.2)"
}
