Skip to content

Main content

Binary Sticky Round Guard Triplet Tool

Compute binary sticky round guard triplet from explicit bounded inputs.

Loading tool…

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

  1. Enter discarded, width. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
discardedDiscardedRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
widthWidth under the stated bit, interval or geometry convention; apply the field-specific units and bounds.Required. Safe integer; minimum 2; maximum 128.
Output fieldInterpretationReturned shape
guardHighest discarded bit.Required. Boolean.
roundSecond-highest discarded bit; width must be at least two.Required. Boolean.
stickyWhether any still-lower discarded bit is one.Required. Boolean.
json
{
  "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

  1. Calculation and input contract: bitwise/binary-sticky-round-guard-triplet — tool.io

Similar or alternative tools