{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.modulo.input.json",
  "title": "Euclidean remainder / modular inverse — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "enum": [
        "remainder",
        "mod",
        "modulo",
        "euclidean",
        "div",
        "inverse",
        "inv",
        "modular_inverse",
        "modular-inverse",
        "modinv",
        "mod_inverse"
      ]
    },
    "a": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
        }
      ]
    },
    "dividend": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
        }
      ]
    },
    "modulus": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
        }
      ]
    },
    "m": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
        }
      ]
    },
    "b": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\s*-?[0-9]{1,48}\\s*$"
        }
      ]
    }
  },
  "allOf": [
    {
      "anyOf": [
        {
          "required": [
            "a"
          ]
        },
        {
          "required": [
            "dividend"
          ]
        }
      ]
    },
    {
      "anyOf": [
        {
          "required": [
            "modulus"
          ]
        },
        {
          "required": [
            "m"
          ]
        },
        {
          "required": [
            "b"
          ]
        }
      ]
    }
  ],
  "description": "Signed integer digit strings up to48 digits and512 characters, or safe JSON integers. Matching aliases must agree numerically. Unknown keys, null, bool, nested values, decimals/scientific notation, overlong tokens and conflicting aliases reject. Runtime enforces nonzero modulus; inverse |modulus|>=2 and coprimality. Modular-inverse entry overrides mode to inverse. (calculation_version 1.1.2)"
}
