Description
Return adjacent finite binary32 raw value patterns toward positive/negative infinity; signed zeros skip the equivalent other zero and extrema return null instead of infinity.
Binary floating-point storage separates sign, biased exponent and fraction fields. Zero and subnormal patterns use a different significand rule from normal values, and reserved exponent patterns represent infinity or NaN. These tools accept exact unsigned raw patterns as decimal integer text, preserving signed-zero and payload evidence without converting the bits into a JavaScript numeric value.
Return adjacent finite binary32 raw value patterns toward positive/negative infinity; signed zeros skip the equivalent other zero and extrema return null instead of infinity.
When to use this tool
Use this tool to return adjacent finite binary32 raw value patterns toward positive/negative infinity; signed zeros skip the equivalent other zero and extrema return null instead of infinity.
How to use the tool and how it works
- Enter pattern using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.nextUp, result.nextDown. Interpret signs, units, ordering and null values using the rules below.
Read an exact unsigned 32-bit pattern from decimal text. Its fields are one sign bit, 8 exponent bits and 23 fraction bits, with exponent bias 127. Reject infinity and NaN. Step the ordered raw bits by one, reversing bit-step direction for negative values. Either signed zero maps upward to positive minimum subnormal and downward to negative minimum subnormal. At a finite extreme return null in the direction that would reach infinity.1, 2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| pattern | Exact unsigned 32-bit raw pattern as decimal integer text, from 0 through 2^32−1. | Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.nextUp | Adjacent finite pattern toward positive infinity, or null at the positive finite extreme. |
| result.nextDown | Adjacent finite pattern toward negative infinity, or null at the negative finite extreme. |
{
"input": {
"pattern": "1065353216"
},
"output": {
"result": {
"nextUp": "1065353217",
"nextDown": "1065353215"
}
}
} Limitations and assumptions
- The equivalent opposite signed zero is skipped when starting at zero. Returned decimal strings are bit patterns, not decimal spellings of their represented values.
- Pattern width is fixed by the tool name. Supply 0≤pattern<2^width as exact decimal integer text, not hexadecimal text or the represented float’s decimal value. Raw-bit operations preserve payloads without guaranteeing runtime NaN behavior.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Distinguish a raw unsigned bit pattern from the decimal value that pattern represents. Use field join/split operations for exact bit editing and a separate numeric conversion when a runtime floating-point value is required.
References
Similar or alternative tools
- IEEE Binary32 Exact Dyadic Record
Decode an exact IEEE binary32 raw pattern into signed integer significand times 2^binaryExponent; infinity/NaN have null dyadic value, negative zero remains explicit.
- IEEE Binary32 Field Joiner
Join explicit IEEE binary32 sign/exponent/fraction fields into exact raw integer pattern text; permits all classes without converting to a JavaScript float.