LOG2 Function (Gnumeric)
Calculate base-two logarithms in Gnumeric with native power-of-two examples, fractional inputs, roundtrip checks and explicit positive-domain errors.
Verification status: 16 reference, boundary and explicit advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Retained native records and independent calculations were checked. Version 1.12.62 was source-checked only. How formula examples are checked
Quick answer: =LOG2(2) gives 1 in the tested Gnumeric 1.12.57 build.
Availability and version history
- Introduced: First release not established.
- Supported in: Gnumeric 1.12.62, with no retirement established.
- Scope: Desktop Gnumeric with the Mathematics plugin; English comma-separated formulas are shown.
- Checked: October 14, 2026. Reference and boundary tables plus the explicit advanced-check formula were recalculated through 1.12.57 ssconvert. Current 1.12.62 source was inspected; that later release was not executed.
What LOG2 returns
LOG2 returns the base-two logarithm of a positive number: the exponent y such that 2^y=x. It is useful for multiplicative scales and powers of two. The result need not be an integer, and values between 0 and 1 have negative logarithms. Versioned function help.
Syntax and arguments
=LOG2(x)
Exactly one numeric x is required, and x must be strictly positive. Zero and negative inputs are explicitly rejected with #NUM!. LOG2 is not a binary-string decoder: quoted digits representing another number system must be converted under that system’s rules first. Function implementation.
Reproducible examples
Ordinary results are rounded to twelve decimal places; tiny nonzero values use scientific notation. The eight reference rows were independently checked.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=LOG2(1) |
0 |
=LOG2(2) |
1 |
=LOG2(8) |
3 |
=LOG2(1024) |
10 |
=LOG2(0.5) |
-1 |
=LOG2(0.125) |
-3 |
=LOG2(3) |
1.584962500721 |
=LOG2(10) |
3.321928094887 |
Practical worksheet
The examples show LOG2(8)=3 and LOG2(1024)=10 because 8=2^3 and 1024=2^10. If a positive quantity grows by a factor of 8, the logarithm of that ratio is 3, corresponding to three doublings. Use a ratio of like units when the interpretation is a dimensionless scale.
For a reduction by a factor of 8, the ratio is 0.125 and the result is −3. A negative logarithm is valid; it does not mean the input was negative.
Advanced interpretation and checks
The native composition =2^LOG2(3)-3 returned 0 in this run. Mathematically the inverse identity holds for every positive real x, but numerical roundtrips can leave small residuals depending on x and floating-point rounding. Do not turn this single exact-zero result into a universal equality guarantee.
The identity LOG2(a×b)=LOG2(a)+LOG2(b) applies when a and b are positive. For very large values, adding the logarithms can avoid an overflowing intermediate product. However, rounding in the logarithms still matters when nearly equal values are subtracted.
Boundaries and troubleshooting
A very large positive input remains valid in the tested example: LOG2(1E300) is approximately 996.578428466209. That does not establish behavior for an input already stored as infinity or an expression that overflows before LOG2 receives it.
The empty F5 reference produced #NUM!, while TRUE became 1 and returned 0. Text “abc” failed. Check missing data and positivity before applying the formula across a column. Do not silently replace an invalid logarithm with zero, because zero is the correct logarithm of 1 and would conceal the original problem.
F5 below is an actually empty cell. The listed errors are native error results, not mathematical zeroes.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=LOG2(0) |
#NUM! |
=LOG2(-1) |
#NUM! |
=LOG2("abc") |
#VALUE! |
=LOG2(F5) |
#NUM! |
=LOG2(TRUE()) |
0 |
=LOG2() |
#N/A |
=LOG2(1E300) |
996.578428466209 |
Official evidence and checking scope
The retained workbook results include a deliberately stale SUM cache and an uncached SUM formula, both recalculated correctly. Native evidence covers the named 1.12.57 build and listed cases; cell-reference layouts and other explanatory compositions are instructions or independent mathematical checks unless explicitly identified as executed. Other locales, direct GUI entry and later-release output were not tested.