Description
Interpret one canonical packed-decimal sign nibble.
Packed binary-coded decimal places decimal digits and sometimes a sign in separate nibbles. Decoding a digit pair differs from interpreting a trailing sign convention or a complete signed field.
Interpret one canonical packed-decimal sign nibble.
When to use this tool
Use Decoding: Signed BCD Trailing Nibble when inspecting a supported packed-decimal nibble or byte.
How to use the tool and how it works
- Enter nibble, convention. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Interpret one canonical packed-decimal sign nibble. Require convention canonical-CDF and nibble C, D or F; negative flags D and unsigned flags F.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| nibble | Nibble | Required. Safe integer. |
| convention | Convention | Required. Text; one of "canonical-CDF". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.negative | Negative | Calculated result member: boolean. |
| result.unsigned | Unsigned | Calculated result member: boolean. |
{
"input": {
"nibble": 13,
"convention": "canonical-CDF"
},
"output": {
"result": {
"negative": true,
"unsigned": false
}
}
} Limitations and assumptions
- C means positive signed; other sign aliases and complete decimal-field decoding are unsupported.
- Outputs are nested inside result. 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 the complete record layout to establish precision, sign policy, byte order and representation validity.
References
Similar or alternative tools
- Decoding: Packed BCD Byte Digits
Decode one packed BCD byte into two digits and a decimal value.
- Msgpack Fixint Signed Value
Decode a positive or negative MessagePack fixint octet.