{
  "category": "Operators",
  "display_name": "Division (/)",
  "entry_kind": "built_in_operator",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.OP_DIVIDE",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 198 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 198 recorded answers",
    "workbook_corpus": {
      "cells": 199,
      "matched": 198,
      "pending": 1,
      "worst_ulp": 0
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/arithmetic.rs#L41-L41"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/arithmetic::divide",
        "catalogue/arithmetic::flushed",
        "catalogue/arithmetic::binary",
        "catalogue/arithmetic::operands"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/arithmetic.rs#L41-L41",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 198 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.OP_DIVIDE.json",
  "name": "OP_DIVIDE",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- [`FUNC.OP_MULTIPLY`](FUNC.OP_MULTIPLY.md) — the inverse operation. `a/b` and `a*(1/b)` are\n  *not* the same double in general: the second rounds twice.\n- `QUOTIENT` — integer division, returning the truncated integer part. Different function,\n  different error surface.\n- `MOD` — the remainder companion. `MOD` has its own sign convention (it follows the divisor)\n  which does not match the truncation implied by `QUOTIENT`; do not assume\n  `a = b*QUOTIENT(a,b) + MOD(a,b)` without checking.\n- `IFERROR`, `IFNA` — the usual wrappers readers reach for when a divisor may be zero.\n  `IFERROR` masks every error, not only `#DIV/0!`, which is a common source of hidden bugs.\n- `IMDIV` — complex division over text-encoded complex numbers.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n- Check the divisor *after* coercion, not before. `\"0\"` as text coerces to zero and must\n  reach the same `#DIV/0!` lane as numeric zero; a pre-coercion check on the raw value misses\n  it.\n- Do not strength-reduce `a/b` into `a * (1/b)`. The reciprocal introduces a second rounding\n  and changes results in the last bit. Compilers do this under fast-math flags; a\n  compatibility implementation must forbid them.\n- A negative zero divisor is still a zero divisor. `x / -0` must take the `#DIV/0!` lane, not\n  produce a negative infinity.\n- In the array case, produce the error per coordinate. Collapsing the whole result to\n  `#DIV/0!` because one cell divided by zero contradicts the per-cell failure rule of chapter\n  02.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n- **Zero divisor.** `#DIV/0!`, including the `0/0` case. Chapter 01 also lists division by an\n  *empty cell* as a documented cause of `#DIV/0!`, which is a useful hint about the family's\n  Empty policy — but the Handbook has not recorded that behaviour for `/` against Excel and\n  does not assert it here.\n- **Text and logical operands.** Shared to-number rules.\n- **Exactness.** Division is exact only when the quotient is representable — mainly powers of\n  two and small integer ratios. `1/3`, `1/10` and most currency ratios are not exact, which\n  is the root of the classic \"my totals are off by a cent\" report. The operator is not at\n  fault; binary64 has no exact tenth.\n\n\n",
    "sources": "- `data/presence/FUNC.OP_DIVIDE.json` — implementing module\n  `earlier-implementation/operator_arithmetic_family.rs`.\n- Handbook `content/model/01-value-universe.md` (the fourteen error codes, including\n  `#DIV/0!` and its \"or by an empty cell\" gloss), `02-coercion-and-lifting.md`,\n  `03-call-pipeline.md`.\n\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`A / B` converts each operand to a number and returns the IEEE-754 binary64 quotient, rounded\nonce to nearest with ties to even — except that a zero divisor does not produce an IEEE\ninfinity but a worksheet error.\n\nEverything else is the shared story: `/` never sees a cell, and each operand is converted by\nthe to-number rules of [coercion and lifting](../model/02-coercion-and-lifting.md).\n\n\n\n### Arguments\n\n\n| Position | Name | Meaning |\n|---|---|---|\n| 0 | `A` | Dividend (numerator). Required. |\n| 1 | `B` | Divisor (denominator). Required. |\n\nArity is exactly 2; no optional arguments, no defaults. Order is load-bearing. In the array\ncase, the divisor position is where the interesting failures live: a single zero anywhere in\na broadcast divisor array produces `#DIV/0!` in exactly the coordinates it reaches, not in\nthe whole result — per-cell failures stay per-cell under the lifting rule of chapter 02.\n\n\n"
  },
  "signature": {
    "display": "number1 / number2",
    "parameters": [
      {
        "description": null,
        "name": "number1",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "number2",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 2,
        "min": 2
      },
      "category": "Operators",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "NumsToNum",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": null,
        "short_source": "no-short-description"
      },
      "docs": null,
      "entry_kind": "built_in_operator",
      "localized_family_names": null,
      "localized_names": [],
      "signature": {
        "display": "number1 / number2",
        "parameters": [
          {
            "description": null,
            "name": "number1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "number2",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "OP_DIVIDE",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": null
  },
  "try_it": {
    "formula": "=7/2"
  },
  "url": "https://handbook.dnacalc.com/functions/OP_DIVIDE.html",
  "variants": [],
  "versions": []
}