For given values ‘a’ and ‘y’ , how to find max x value such that x = a^b < y for b∈N and a>0.
For example, y=14 and a = 2 is given, then x must be 8. In other words,for all values of y in [8.15] , x must be 8.
Similarly, for all values of y in [9,26] , x must be 9.
For given values ‘a’ and ‘y’ , how to find max x value such
Share
You can use log with base a. Such a function does not exist in
<cmath>, but if you remember the formula thatYou can do it with cmath’s log (natural logarithm) function.