log2Log of Base 2
log2(A)A should be a numeric array.A.A.log2(a) may be a complex number when a is complex or a negative real number.% Returning complex numbers.
log2([-inf rand + rand*i -rand])
% Returning real numbers.
log2([inf nan 0 rand])
ans =
Inf + 4.5324i 0.2044 + 0.7616i -1.6523 + 4.5324i
ans = 1e-2 ×
Inf NaN -Inf -2.8720