Description
Compare an explicitly quantized measurement with a supplied upper limit; nearest ties are toward positive infinity.
Quality records separate measured results, reference values, acceptance rules, and supporting evidence. Arithmetic consistency and record coverage can be checked against supplied criteria without establishing traceability, approving a method, or deciding product conformity.
Compare an explicitly quantized measurement with a supplied upper limit; nearest ties are toward positive infinity.
When to use this tool
Use it for specification rounding margin when the required inputs and conventions are already available.
How to use the tool and how it works
- Enter value, quantum, suppliedLimit, mode. Use the stated units and boundary conventions.
- Run the calculation. Correct any input error before interpreting a result.
- Read rounded, margin. Inspect any known, defined, inclusion, or boundary flags before interpreting numeric values.
Require positive quantum and mode floor, ceil, or nearest. Divide value by quantum, apply the chosen JavaScript rounding operation, multiply back by quantum, and return margin=suppliedLimit-rounded.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| value | Value | Required. Finite number. |
| quantum | Quantum | Required. Finite number; strictly above 0. |
| suppliedLimit | Supplied Limit | Required. Finite number. |
| mode | floor, ceil, or nearest; nearest follows JavaScript Math.round ties. | Required. Text; one of "floor", "ceil", "nearest"; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| rounded | Rounded | Required. Finite number. |
| margin | Margin | Required. Finite number. |
{
"input": {
"value": 4.6,
"quantum": 1,
"suppliedLimit": 5,
"mode": "ceil"
},
"output": {
"rounded": 5,
"margin": 0
}
} Limitations and assumptions
- Nearest uses Math.round, whose exact negative half ties go toward positive infinity. Binary floating-point arithmetic can affect ties; this does not select a compliant reporting or acceptance rule.
- The field tables describe structural bounds; the mechanics also state cross-field requirements. Malformed input shapes, disallowed keys, and invalid domains cause input errors. Results must remain finite and within the declared output contract. A successful false flag or zero placeholder is distinct from an error.
- Numeric arithmetic uses binary floating point. Exact comparisons have no hidden tolerance or decimal rounding; negative zero is exported as zero. Decimal-text integer operations retain the exactness specifically stated above.
Alternative or Complementary methods
For specification rounding margin, check the source records and the supplied rule before comparing the result with another method. Use a separate evidence or method review when arithmetic consistency alone cannot establish the required conclusion.
References
Similar or alternative tools
- QC Specification One Sided Margin
Evaluate one explicitly supplied specification side and equality convention.
- QC Result Rounding Closure Token
Inspect a supplied nearest-rounding interval and tie endpoint convention without rerounding an assay result.