Formualizer Docs

IMLOG2

Returns the base-2 logarithm of a complex number.

Produces the principal complex logarithm in base 2.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=IMLOG2(inumber)

Arguments

ArgumentTypeRequiredDefault
inumberanyRequired—

Return type

Can return text.

How it works

The principal logarithm in base 2 is the principal natural logarithm divided by ln(2). It is undefined at zero and inherits the negative real branch cut.

Differences from Excel

The raw Formualizer text can contain more significant digits than Excel’s complex-number text. The examples round each coefficient to 15 significant digits for display.

Remarks

  • Input is coerced to complex-number text before parsing.

Error cases

  • Returns #NUM! for zero input.
  • Invalid complex text returns #NUM!.

Examples

Compute the complex logarithm at 3 + 4i on a base-two scale.

Formula =IMLOG2("3+4i")

Expected result 2.32192809488736+1.33780421245098i

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Change the sign of the angle term scaled by ln(2).

Formula =IMLOG2("3-4j")

Expected result 2.32192809488736-1.33780421245098j

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

On the positive real axis, one has base-two logarithm zero.

Formula =IMLOG2("1")

Expected result 0

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The text “invalid” has no complex value from which to take the base-two logarithm.

Formula =IMLOG2("invalid")

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Base-2 log of a real value

Formula =IMLOG2("8")

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Base-2 log on imaginary axis

Formula =IMLOG2("i")

Expected result 2.2661800709136i

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

When does IMLOG2 return #NUM!?

It returns #NUM! for invalid complex text or zero input, where logarithm is undefined.

Implementation

Engine source

On this page