Hello,
I'm trying to make a calculator where the user can input the base of the logarithm function, instead of having to convert it from the default log(base)10. Is there any way to do this in C++?
Thanks!
Carpetfizz

#include <cmath>

inline double log_to_base( double value, double base )
{ return std::log(value) / std::log(base) ; }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.