Description
Subtract firstAyah from lastAyah and add one when includeEnd is true.
Source-scoped cultural and historical records preserve an edition, naming convention, or local identifier. Literal agreement is useful bookkeeping but does not establish interpretation, authenticity, or authority.
Subtract firstAyah from lastAyah and add one when includeEnd is true.
When to use this tool
Use Public Manuscript Ayah Range when you need a precise source-token or range consistency check.
How to use the tool and how it works
- Enter firstAyah, lastAyah, sourceEdition, includeEnd. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read count, sourceKey. Use the output convention below.
Subtract firstAyah from lastAyah and add one when includeEnd is true. Serialize sourceEdition and endpoints as sourceKey.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstAyah | First Ayah | Required. Safe integer; minimum 1. |
| lastAyah | Last Ayah | Required. Safe integer. |
| sourceEdition | Source Edition | Required. Text; maximum UTF-16 length 8192. |
| includeEnd | Include End | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| count | Count | Required. Safe integer. |
| sourceKey | JSON-array serialization retaining the supplied source and identifying coordinates. | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"firstAyah": 3,
"lastAyah": 8,
"sourceEdition": "edition-A",
"includeEnd": true
},
"output": {
"count": 6,
"sourceKey": "[\"edition-A\",3,8]"
}
} Limitations and assumptions
- This applies an explicit endpoint convention without validating a surah, edition, or actual verse text.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Consult the source edition and relevant community or scholarly guidance before interpreting or reusing the material.
References
Similar or alternative tools
- Public Ayah Range Overlap
Count the inclusive overlap as max(0, min(ends) - max(starts) + 1) across two ordered positive ayah ranges.
- Quran Surah Ayah Range Parser
Parse positive surah:ayah or surah:first-last syntax without leading zeros.