Skip to content

Main content

Mantissa Sign Field Width Tool

Count only explicit mantissa sign occupancy under a supplied display policy, excluding digits and exponent width.

Loading tool…

Description

Accept auto, always, never or except-zero policy.

Alignment requires a declared measure of width. ASCII token characters, supplied display-cell widths and actual rendered glyph widths are different, so a column budget is meaningful only under its stated convention.

Accept auto, always, never or except-zero policy.

When to use this tool

Use Mantissa Sign Field Width when you need a supplied field-width or padding calculation.

How to use the tool and how it works

  1. Enter negative, zero, policy. 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 signColumns, signToken. Use the output convention below.

Accept auto, always, never or except-zero policy. Choose minus from negative, plus under the positive policies, or empty as required, and return sign token and its length.1

Input fieldMeaning and unitsAccepted input
negativeNegativeRequired. Boolean.
zeroSupplied zero-status flag; no mantissa is parsed.Required. Boolean.
policyPolicyRequired. Text; one of "auto", "always", "never", "except-zero"; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
signColumnsSign ColumnsRequired. Safe integer.
signTokenSign TokenRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "negative": false,
    "zero": false,
    "policy": "always"
  },
  "output": {
    "signColumns": 1,
    "signToken": "+"
  }
}

Limitations and assumptions

  • The negative and zero flags are independent supplied metadata. No mantissa is inspected; signColumns describes these one-character ASCII tokens only.
  • 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.

Alternative or Complementary methods

Measure text in the actual font, terminal or output environment when visual alignment matters. Account for encoding, combining marks, wide characters and locale rather than inferring display width from text length alone.

References

  1. Calculation and input contract: format/mantissa-sign-field-width — tool.io

Similar or alternative tools