{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.divide/1.0.7/input.json",
  "title": "Division — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "enum": [
        "quotient",
        "long",
        "long-division"
      ]
    },
    "decimals": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 16
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*(?:(?:0*[0-9]|0*1[0-6]))?\\s*$"
        }
      ]
    },
    "decimalsInput": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 16
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*(?:(?:0*[0-9]|0*1[0-6]))?\\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*$"
        }
      ]
    },
    "dividend": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ]
    },
    "dividendInput": {
      "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*$"
        }
      ]
    },
    "divisor": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ]
    },
    "divisorInput": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*[+-]?(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ]
    }
  },
  "allOf": [
    {
      "anyOf": [
        {
          "required": [
            "a"
          ]
        },
        {
          "required": [
            "dividend"
          ]
        },
        {
          "required": [
            "dividendInput"
          ]
        }
      ]
    },
    {
      "anyOf": [
        {
          "required": [
            "b"
          ]
        },
        {
          "required": [
            "divisor"
          ]
        },
        {
          "required": [
            "divisorInput"
          ]
        }
      ]
    },
    {
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "long",
              "long-division"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "properties": {
          "a": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "maxLength": 512,
                "pattern": "^\\s*\\+?[0-9]+\\s*$"
              }
            ]
          },
          "dividend": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "maxLength": 512,
                "pattern": "^\\s*\\+?[0-9]+\\s*$"
              }
            ]
          },
          "dividendInput": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "maxLength": 512,
                "pattern": "^\\s*\\+?[0-9]+\\s*$"
              }
            ]
          },
          "b": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "maxLength": 512,
                "pattern": "^\\s*\\+?[0-9]+\\s*$"
              }
            ]
          },
          "divisor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "maxLength": 512,
                "pattern": "^\\s*\\+?[0-9]+\\s*$"
              }
            ]
          },
          "divisorInput": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "maxLength": 512,
                "pattern": "^\\s*\\+?[0-9]+\\s*$"
              }
            ]
          }
        }
      }
    }
  ],
  "description": "Both operands required via matching aliases. Missing mode→quotient; long-division aliases long. Default decimals8 only missing/blank; integer0–16. Runtime enforces aliases,48-digit long limit and all normalized integral quotient operands within±(2^53−1), binary64 overflow/nonzero-underflow. Strings max512 characters. Exactness is relative to normalized binary64 operands; decimal input conversion may round. (calculation_version 1.0.7)"
}
