How to change the base of a logarithm
The Saia PCD® instruction set does support the natural logarithm Ln (hyperbolic, base e, floating point instruction FLN). Logarithms to any other base like 10 (Log10) can be calculated with the method described below.
The Ln of x can be divided by the Ln of the desired base: Log n (x) = Ln(x) / Ln(n)
Example in case the logarithm with the base 10 is needed:
Log10(x) = Ln(x) / Ln(10)
The value of Ln(10) (=2.302585093) can be stored in a constant or variable so it does not need to be recalculated each time a Log10 is required.
Local FAQ Deutschland / Fupla
PG5 2.0 / Fupla
PG5 2.0 / SEdit (IL programming)
Last update: 29.05.2015 16:45
First release: 18.06.2009 12:36