{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.subtraction.input.json",
  "title": "Subtraction — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "enum": [
        "difference",
        "diff",
        "sub",
        "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*$"
        }
      ]
    },
    "minInput": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
        }
      ]
    },
    "a": {
      "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*$"
        }
      ]
    },
    "subInput": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
        }
      ]
    },
    "b": {
      "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*$"
        }
      ]
    },
    "diffInput": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
        }
      ]
    },
    "d": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*(?:[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)?\\s*$"
        }
      ]
    }
  },
  "anyOf": [
    {
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "minuend"
              ]
            },
            {
              "required": [
                "minInput"
              ]
            },
            {
              "required": [
                "a"
              ]
            }
          ]
        },
        {
          "anyOf": [
            {
              "required": [
                "subtrahend"
              ]
            },
            {
              "required": [
                "subInput"
              ]
            },
            {
              "required": [
                "b"
              ]
            }
          ]
        }
      ]
    },
    {
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "minuend"
              ]
            },
            {
              "required": [
                "minInput"
              ]
            },
            {
              "required": [
                "a"
              ]
            }
          ]
        },
        {
          "anyOf": [
            {
              "required": [
                "difference"
              ]
            },
            {
              "required": [
                "diffInput"
              ]
            },
            {
              "required": [
                "d"
              ]
            }
          ]
        }
      ]
    },
    {
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "subtrahend"
              ]
            },
            {
              "required": [
                "subInput"
              ]
            },
            {
              "required": [
                "b"
              ]
            }
          ]
        },
        {
          "anyOf": [
            {
              "required": [
                "difference"
              ]
            },
            {
              "required": [
                "diffInput"
              ]
            },
            {
              "required": [
                "d"
              ]
            }
          ]
        }
      ]
    }
  ],
  "description": "Difference requires exactly two nonblank terms; Long requires minuend/subtrahend and blank/absent difference. Aliases must agree including blanks. Decimal tokens up to512 characters; no commas. Runtime enforces binary64 finite/safe-integral/nonzero-underflow rules and Long nonnegative48 aligned columns. Blank fields are omitted from normalized inputs. Long display/exact_value exact; numeric fields approximate. (calculation_version 1.0.2)"
}
