I'm working on a program where the problem has a natural logarithmic scale.
So far I'm using base 2, with a nice implementation of unsigned int log2(uint64_t)
(in C/C++), found here.
However, I found that base 2 is too much for my problem: I need to use fractional bases, e.g. 3/2.
Is anyone aware of an implementation for this kind of operation?
My current solution is round(log(x)/log(base))
where round returns integer, but I was hopping, at least, to avoid two evaluations of the log.