# Logarithm tricks

(Redirected from Logarithm)
 This article/section is a stub — probably a pile of half-sorted notes and is probably a first version, is not well-checked, so may have incorrect bits. (Feel free to ignore, or tell me)

### properties of logs

#### Change of log base

If you want to work with an arbitrary base, but you have a log function of which you cannot change the base (e.g. on a calculator), then a useful property is:

```logw v = ( logh v ) / ( logh w )
```

where

w is the base you want
h is the base you have (which you don't even have to know the value of, just has to be consistent just has to be consistent between the two uses)
v is the value you want the logw of

Say you want the log-base-2 of 256

...but are working with base 10
```log2(256) = ( log10(256) ) / ( log10(2) ) ≈ 2.40824 / 0.30103 ≈ 8
```
...or are working with base e
```log2(256) = ( loge(256) ) / ( loge(2) ) ≈ 5.54518  / 0.69315 ≈ 8
```

```logb(x*y) = logb x + logb y
```

#### subtraction is division

```logb(x/y) = logb x - logb y
```

### Decibels

Decibels are logarithms applied to ratios of power.

Which turns out to be rather useful idea.