← All built-ins / log2()

log2()

log2(mixed $number): float

Parameters

NameTypeDescription
$numberfloat|intpositive input

Return value

Base-2 logarithm.

Example

echo log2(8), " ", round(log2(10), 4);
3 3.3219

See also

log()log10()