FUNCTION REFERENCE

log2

Base-2 logarithm.

Base-2 logarithm.

Syntax

log2(X)

Syntax

[F, E] = log2(X)

The two-output form splits x into F and E with x = F * 2^E and 0.5 <= abs(F) < 1.

Example

[f, e] = log2(8)   % f = 0.5, e = 4

Differences from MATLAB: Double arrays only. The two-output form needs real input; complex input is rejected.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.