← All built-ins / log2()
log2()
log2(mixed $number): float
Parameters
| Name | Type | Description |
|---|---|---|
| $number | float|int | positive input |
Return value
Base-2 logarithm.
Example
echo log2(8), " ", round(log2(10), 4);
3 3.3219
| Name | Type | Description |
|---|---|---|
| $number | float|int | positive input |
Base-2 logarithm.
echo log2(8), " ", round(log2(10), 4);
3 3.3219