has two variables: x and y. you need to calculate the logarithm of x to base y. how to implement it?
the standard log function counts only natural logarithms and base 10 logarithms
Answer 1, authority 100%
A bit of school mathematics … The properties of logarithms are below. Take a close look at the tenth property. Explain in more detail? 🙂
For example, the base 5 logarithm of x is calculated as
log (x) / log (5)
Answer 2, authority 14%
The standard function std :: log
does not count the decimal logarithms, but counts natural logarithms. There is also std :: log10
, std :: log2
, std :: log1p
. For the rest, count using the following property, which follows from the definition of the logarithm function: