Calculates the logarithm with a configurable base.
FLOAT64Diperbarui: 13 Jun 2026LOG(expression [, base])A positive number
The logarithm base (default: e for natural log)
1 SELECT 2 LOG(100, 10) as log_base_10, 3 LOG(8, 2) as log_base_2, 4 LOG(EXP(1)) as natural_log;
Logarithms with various bases.
| log_base_10 | log_base_2 | natural_log |
|---|---|---|
| 2.0 | 3.0 | 1.0 |
1 SELECT 2 number, 3 CEIL(LOG(number, 2)) as bits_needed 4 FROM UNNEST([1, 7, 8, 255, 256]) as number;
Calculates the number of bits required to represent a value.
Sudah paham LOG? Latih langsung di browser
Latihan interaktif, langsung di browser.