Skip to content

Main content

Radix Integer Single Digit Borrow Tool

Calculate radix integer single digit borrow from explicit caller-supplied inputs.

Loading tool…

Description

Return the nonnegative remainder modulo radix as digit and outgoingBorrow one only when the raw subtraction is negative.

A positional representation depends on its radix, digit range, sign convention, and treatment of leading zeros. Ordinary bases use digits from zero through radix minus one, while negative and bijective bases have different conversion rules. A single carry, borrow, or denominator step is distinct from formatting a complete number.

Return the nonnegative remainder modulo radix as digit and outgoingBorrow one only when the raw subtraction is negative.

When to use this tool

Use Radix Integer Single Digit Borrow when you need this digit, carry, borrow, sign, width, or denominator component for an explicit radix convention.

How to use the tool and how it works

  1. Enter digit, radix, incomingBorrow. 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 digit, outgoingBorrow. Use the output convention below.

For radix in 2..36, a valid digit, and incomingBorrow zero or one subtract the borrow. Return the nonnegative remainder modulo radix as digit and outgoingBorrow one only when the raw subtraction is negative.1

Input fieldMeaning and unitsAccepted input
digitNumeric digit under the stated radix convention.Required. Safe integer; minimum 0.
radixPositional base within the explicit stated bound.Required. Safe integer; minimum 2; maximum 36.
incomingBorrowIncoming BorrowRequired. Safe integer; minimum 0; maximum 1.
Output fieldInterpretationReturned shape
digitNumeric digit under the stated radix convention.Required. Safe integer.
outgoingBorrowOutgoing BorrowRequired. Safe integer.
json
{
  "input": {
    "digit": 0,
    "radix": 10,
    "incomingBorrow": 1
  },
  "output": {
    "digit": 9,
    "outgoingBorrow": 1
  }
}

Limitations and assumptions

  • This is one positional column with a unit borrow. It does not subtract another digit, process an entire number, or handle signed/negative-radix representations.
  • 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

Choose the full conversion or formatting workflow for the intended representation. Keep radix, digit alphabet, leading-zero width, signed-zero handling, and terminating/repeating-fraction assumptions explicit.

References

  1. Calculation and input contract: number/radix-integer-single-digit-borrow — tool.io

Similar or alternative tools

  • Positional Digit Carry Single Column

    For radix in 2..256, left and right digits within zero through radix-1, and incoming zero or one return digit=(left+right+incoming) modulo radix and carry=floor(sum/radix).

  • Bijective Radix One Digit Borrow

    For positive integer integer and radix in 2..36 return quotient=floor((integer-1)/radix) and digit=((integer-1) modulo radix)+1.