LOG
A number's logarithm, base 10 unless a base is given.
Group: Math. Compatible with DAX.
Syntax
LOG ( <number> [, <base>] )
| Parameter | Type | Description |
|---|---|---|
number | Number | A number above 0. |
base | Number optional | The base: above 0 and not 1. 10 when left out. |
Returns
Number. The power the base must be raised to in order to give the number.
Remarks
- 0 and negative numbers are errors; so is a base of 0, 1 or below 0.
- A blank number gives minus infinity (-Infinity), or plus infinity for a base below 1.
- In base 10 the result is exact for powers of ten:
LOG ( 1000 )is 3, whereLN ( 1000 ) / LN ( 10 )is a hair off. LOG ( x, EXP ( 1 ) )isLN ( x );LOG ( x )isLOG10 ( x ).
Examples
Different bases
EVALUATE
ROW (
"Of 100", LOG ( 100 ),
"8 in base 2", LOG ( 8, 2 ),
"81 in base 3", LOG ( 81, 3 ),
"8 in base 0.5", LOG ( 8, 0.5 )
)
| Of 100 | 8 in base 2 | 81 in base 3 | 8 in base 0.5 |
|---|---|---|---|
| 2 | 3 | 4 | -3 |
Exact powers of ten
EVALUATE
ROW (
"LOG", LOG ( 1000 ) = 3,
"LN over LN", LN ( 1000 ) / LN ( 10 ) = 3
)
| LOG | LN over LN |
|---|---|
| TRUE | FALSE |