BITRSHIFT Function (Gnumeric)
Use Gnumeric BITRSHIFT for binary fields and integer division, with negative-shift reversal, lost-bit examples and native boundary behavior.
Verification status: 19 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Retained native records and independent integer calculations were checked. Version 1.12.62 was source-checked only. How formula examples are checked
Quick answer: =BITRSHIFT(9,5) gives 0 in the tested Gnumeric 1.12.57 build.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source.
- Supported in: Gnumeric 1.12.62; no retirement is established.
- Scope: Desktop Gnumeric with its Number Theory plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables and the named advanced check were recalculated with 1.12.57 ssconvert. Current 1.12.62 source was inspected; the later release was not executed.
What BITRSHIFT returns
BITRSHIFT moves a nonnegative integer’s binary representation right by a specified count. Bits falling below the lowest position are discarded. For a nonnegative integer and an ordinary positive count, this agrees with division by a power of two followed by flooring. Versioned function help.
Syntax and arguments
=BITRSHIFT(value,shift)
Both value and shift are required. The value is converted to an unsigned integer after its range check. The shift count is floored. A negative count changes the operation to a left shift; for example, −0.9 is floored to −1, so it shifts left one place.
Reproducible examples
These eight native integer results were independently checked by binary arithmetic or elementary number theory.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=BITRSHIFT(9,5) |
0 |
=BITRSHIFT(16,2) |
4 |
=BITRSHIFT(31,1) |
15 |
=BITRSHIFT(5,-1) |
10 |
=BITRSHIFT(5,0) |
5 |
=BITRSHIFT(0,3) |
0 |
=BITRSHIFT(1,10) |
0 |
=BITRSHIFT(255,4) |
15 |
Practical worksheet
With binary 10000, shifting right twice gives 100, decimal 4: =BITRSHIFT(16,2) returns 4. For 31, shifting right once gives 15; the low bit is lost rather than rounded into the quotient.
For a packed numeric field in A2, a right shift can remove the low positions before masking the desired width. Keep that workflow restricted to validated nonnegative integers. This function does not perform a signed arithmetic shift on negative values.
Advanced interpretation and checks
Discarded low bits cannot be reconstructed just by shifting back. =BITLSHIFT(BITRSHIFT(13,2),2) returned 12, not 13. Binary 1101 becomes 11 and then 1100. This makes the operation useful for removing low-bit detail but unsuitable for reversible arithmetic without retaining the remainder.
A negative count invokes unsigned left shifting. The native case =BITRSHIFT(4503599627370496,-12) returned 0 after the high bit was discarded at 64 bits. Do not treat the negative-count branch as an unlimited exact multiplication.
Version-specific source differences
For the standard binary64 build, the older shared input bound is 2^52 = 4503599627370496. The pinned 1.12.62 expression raises it to 2^53 = 9007199254740992. This change is established by comparing the older bound with the current bound; it is not a native test of 1.12.62. Input acceptance and exact representability of every resulting integer are separate questions.
Boundaries and troubleshooting
Counts at least 64 or at most −64 explicitly return zero. Negative input values are rejected with #NUM!; they are not sign-extended. Text that cannot become a number gives #VALUE!, and a missing shift argument gives #N/A in the tested build. Large outputs from the reverse-direction branch still use finite-precision numeric storage.
F5 is an actually empty cell. Listed errors are native error results, not mathematical zeroes.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=BITRSHIFT(9.9,1) |
4 |
=BITRSHIFT(8,1.9) |
4 |
=BITRSHIFT(8,-0.9) |
16 |
=BITRSHIFT(-1,2) |
#NUM! |
=BITRSHIFT(1,64) |
0 |
=BITRSHIFT(1,-64) |
0 |
=BITRSHIFT(F5,2) |
0 |
=BITRSHIFT("abc",2) |
#VALUE! |
=BITRSHIFT(8) |
#N/A |
=BITRSHIFT(4503599627370496,-12) |
0 |
Official evidence and checking scope
The retained workbook contained a deliberately stale SUM cache and an uncached SUM formula, both recalculated correctly. Native evidence covers the listed 1.12.57 cases. Other worksheet layouts and mathematical interpretations are separately explained checks. GUI entry, other locales and later-release output were not tested.