Description
Split discarded bits into guard, round and sticky flags.
Fixed-width arithmetic can wrap, saturate, shift in sign bits or expose discarded bits. Carry, borrow and signed overflow describe different conditions; a local rounding decision or guard/sticky triplet is one part of an arithmetic operation rather than a complete floating-point result.
Split discarded bits into guard, round and sticky flags.
When to use this tool
Use Binary Sticky Round Guard Triplet when evaluating the stated shift, arithmetic flag or rounding convention.
How to use the tool and how it works
- Enter discarded, width. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read guard, round, sticky. Inspect guard, round, sticky before interpreting the associated values.
Split discarded bits into guard, round and sticky flags. Require width 2..128 and bounded exact discarded word; guard is highest bit, round next highest, sticky is OR of all remaining low bits.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| discarded | Discarded | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| width | Width under the stated bit, interval or geometry convention; apply the field-specific units and bounds. | Required. Safe integer; minimum 2; maximum 128. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| guard | Highest discarded bit. | Required. Boolean. |
| round | Second-highest discarded bit; width must be at least two. | Required. Boolean. |
| sticky | Whether any still-lower discarded bit is one. | Required. Boolean. |
{
"input": {
"discarded": "13",
"width": 4
},
"output": {
"guard": true,
"round": true,
"sticky": true
}
} Limitations and assumptions
- The discarded-bit order is supplied and width two has no sticky tail; retained digits and an actual rounded value are not computed.
- 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
Use a complete arithmetic operation with explicit width, signedness, overflow and rounding policy; keep exact integer text when values exceed ordinary numeric precision.
References
Similar or alternative tools
- Binary Round To Even Increment Decision
Return a round-to-nearest-even increment decision.
- Bitword Offset Binary To Unsigned Tool
Compute bitword offset binary to unsigned from explicit bounded inputs.