I have written a small program to develop logarithmic code and I have taken 3 variables, x
, y
and p
, where x
is base, y
is log value and p
is default value (power of 'x
'). Now I am not getting error when I executed it but it didn't display any answer on terminal. It will be handy when someone provide solution to it.
algo1 <- function(x, y) {
p <- 1
if (x ^ p == y) {
print(p)
} else {
p <- p + 1
}
algo1(3, 81)