Create algorithm that calculates LOG in visualg [closed]

1

I was given a list of exercises to do in VisuAlg and I am doubtful in one of these exercises:

  

"Enter the number and base on which you want to calculate the log of that number and print it."

I know I have a function that calculates logarithms in base 10 (LOG) but I have no idea how to calculate logarithm without being in base 10.

    
asked by anonymous 06.12.2017 / 12:35

1 answer

0

Mathematically:

log b(x) = log k(x) / log k(b)

where b and k are bases.

So log of x in base 2 in VisuAlg would be:

log(x) / log(2)
    
09.12.2017 / 14:34